Sunday, November 22, 2015

Arduino Makefile on Mac OSX

In my continuing project to build a little hexapod robot, I figured I would try to get the Arduino code running from the command line.  I like to use Emacs and all that, old school style.  Here's what I did to get that going.

  1. I cloned Arduino-Makefile off of Github.
  2. I installed CrossPack for AVR to get the AVR toolchain.
  3. I set various environment variables in my ~/.profile .  You'll need to set these according to the system and board that you actually have.
    • ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
    • ARDMK_DIR = $HOME/Dropbox/Robotics/Arduino-Makefile
    • ARDUINO_CORE_PATH = /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino
    • BOARDS_TXT = /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/boards.txt
    • AVR_TOOLS_DIR = /usr/local/CrossPack-AVR
    • MONITOR_PORT = /dev/cu.usbserial-AL01CARS
    • BOARD_TAG = diecimila
    • BOARD_SUB = atmega328
  4. After setting these up, make show_boards, make, and make upload seemed to work.

No comments:

Post a Comment