Teensy 3.1 / Arduino Programming Guide



1) Download / Install the Arduino IDE

Grab it from Arduino’s main download page and install it.

NOTE: This guide assumes some basic knowledge about using the Arduino IDE and installing Arduino Libraries.


2) Download and install TeensyDuino

Be sure your Arduino IDE is not running. Head on over to PJRC’s Teensyduino download link. and download / install the file “Windows XP / 7 / 8 / 10 Installer“.


3) Download and install fastLED 3.1 and OctoWS2811 Arduino libraries

The Arduino Sketch is a highly optimized hybrid of two libraries, the FastLed lib and the OctoWS2811 lib. Download the following zip files.

FastLED3_1.zip

OctoWS2811.zip

Typically, Arduino libraries are installed in “C:\Users\<username>\Documents\Arduino\libraries


4) Check and configure your Arduino IDE for Teensy devices.

 

Check to see if your Teensyduino installer correctly installed the necessary files into your Arduino IDE.

You should see the following devices under the tools menu:


5) Download and unzip Pixel Driver Sketch into your projects folder.

ledPixelController_400.zip

Typically, Arduino project files are stored in “C:\Users\<username>\Documents\Arduino

Take the folder from ledPixelController_400.zip and place it in the above directory.


6) Open ledPixelController_400.ino

This sketch is quite straight forward – it takes incoming serial data and blindly shoves it out onto the led’s. Using the two libraries together allows the Teensy 3.1 to prepare the data and send it out VERY fast allowing for up to 460 led’s per each of the 8 outputs.

In the downloadable file the led count is set to 400 which doesn’t quite push the boundaries as much and can ensure that with a good multi-tt hub you can have 3-4 teensys connected and maintain 60 fps.

If you notice your image being sent to the led’s begins to lag behind GeoPix more and more, you probably have a bottleneck in your hub. USB 3.0 ports are recommended if using more than 2 teensys on a hub.

The Pixel controller Sketch will look like this upon opening:

Feel free to change the highlighted text – the led count variable “NUM_LEDS_PER_STRIP” can be anything up to 460. Be sure to match the variable you set here in GeoPix later too.


7) Upload the sketch to your teensy.

At this point, assuming you have a teensy and have it connected and recognized (you can check your COM ports in device manager for confirmation) You can upload the Pixel Driver Sketch to your board.

Your Teensy is done with programming.

Feel free to change the highlighted text – the led count variable “NUM_LEDS_PER_STRIP” can be anything up to 460.


8) Hardware setup and wiring…

There are a number of ways to setup your power and hardware which is out of the scope of this guide.

For more info on wiring and power, check out this detailed guide on PJRC. You can ignore any programming or software portions of the guide on PJRC since GeoPix handles everything else intelligently.