Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ah-cog/4d06b8cd3276aa7286d1 to your computer and use it in GitHub Desktop.
Save ah-cog/4d06b8cd3276aa7286d1 to your computer and use it in GitHub Desktop.
Upload to the Teensy 3.1 from Terminal on OS X with Arduino 1.6.1 and Teensyduino 1.21.

Uploading Arduino Sketches to the Teensy 3.1 from the Terminal

First, install Arduino 1.6.1 from http://arduino.cc/en/Main/Software. I followed the Mac OS X for Java 6 link to download arduino-1.6.1-macosx.zip. Install Arduino by unzipping the Arduino file and moving it to /Applications/Arduino. Open Arduino to make sure it works and so it can finish setting up the environment for use. Next, install Teensyduino 1.21 from https://www.pjrc.com/teensy/td_download.html. I followed Macintosh OS-X Installer to download teensyduino.dmg. Open and proceed through the Teensyduino installer, and when prompted to locate Arduino, select /Applications/Arduino, then continue to the next step in the installer.

At this point, you should be ready to upload a sketch. Follow the instructions below.

To upload from the terminal, enter the following command:

/Applications/Arduino.app/Contents/MacOS/JavaApplicationStub --board teensy:avr:teensy31 --port /dev/tty.usbmodem573061 --upload /Users/mokogobo/Checkouts/pixel/Firmware/Pixel_Firmware/Pixel_Firmware.ino --pref custom_speed=teensy31_96opt

To monitor the serial output from the Arduino, enter the command:

screen /dev/tty.usbmodem573061 115200

To exit screen enter the command Control + A then Control + /. You may need to press Return to see the terminal prompt again.

Notes

The above commands make the following assumptions:

  • Arduino 1.6.1 has been installed to /Applications/Arduino.
  • The Teensy 3.1 device appears as /dev/tty.usbmodem573061. Correct this for your device. List available USB devices by entering the command ls /dev/tty.usb*. You may also find this in the Arduino application in the Tools > Port menu.
  • The full path to the main .ino sketch is /Users/mokogobo/Sandbox/Checkouts/pixel/Firmware/Pixel_Firmware/Pixel_Firmware.ino. Set this to the full path of your sketch.
  • The serial output is set to 115200 baud. That is, the Arduino sketch calls Serial.begin (115200);. Change this as needed.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment