Teensy and FloraPixel v1

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
winhack
 
Posts: 3
Joined: Wed May 30, 2012 10:48 pm

Teensy and FloraPixel v1

Post by winhack »

Hey all,

I am trying to connect up a FloraPixel to a Teensy++ 2.0. I can write and compile .C projects using make for the Teensy and that works just fine (I can blink it's onboard light the way I want to). When I switch to the Arduino IDE environment (after putting the Teensy hardware files in 1.0.3 as the pjrc website describes), I cannot seem to get the Teensy to work with the FloraPixel. I am sure it has something to do with the header files not being correct for the different AVR hardware (non-Flora).

I would be fine just using C or C++ for the Teensy, but I cannot seem to figure out which .h files are needed or which changes those .h files would need in order to work correctly together. Has anyone tried this already and succeeded? Can anyone point me in the right direction?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Teensy and FloraPixel v1

Post by adafruit_support_mike »

The Adafruit library file and header (plus an example file) live at gitHub: https://github.com/adafruit/Adafruit-Fl ... el-Library

The code is C++, but the header does include a few other Arduino-specific headers. Fair warning, the code that talks to the Pixel is written in assembler. That probably won't port to another architecture, but at least you'll be able to see all the gory details of how the Arduino talks to the Pixel.

User avatar
winhack
 
Posts: 3
Joined: Wed May 30, 2012 10:48 pm

Re: Teensy and FloraPixel v1

Post by winhack »

Hi mstone,

I think I have that code already, but from what I can tell, it seems to be geared towards the Flora as the microcontroller, not another device. The Teensy++ 2.0 is a different Atmel chip (the at90usb1286), but it has all the plugins/library/samples for the Arduino IDE. I will try again to can do to make that work.

I also downloaded the Adafruit WS2801 library, which from my reading of the website and the various tutorial pages, is similar to what is needed to control the pixel, but there seems to be at least one major difference. The pixels in the WS2801 tutorial require 4 wires, whereas it seems that the FloraPixel only needs 3.

Just to start out, I am just trying to blink the pixel on and off, not even worried about color yet. I will keep searching around and trying the code until I get figure out what I need to do. Maybe it's the wrong pins...I don't know.

Thank you for your help.

User avatar
winhack
 
Posts: 3
Joined: Wed May 30, 2012 10:48 pm

Re: Teensy and FloraPixel v1

Post by winhack »

Got it working. I needed to make one change and fix something.

For the change, I needed to change a line of code in the Adafruit_FloraPixel.h file from:

Code: Select all

#elif defined(__AVR_ATmega32U4__)
to

Code: Select all

#elif defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB1286__)
After making that change, I also found that I needed to clip the aligator clips a lot more carefully as they were clearly shorting something on the underside of the pixel that was not apparently to me before.

After that code change and fixing my mistake, it worked just fine.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Teensy and FloraPixel v1

Post by adafruit_support_mike »

winhack wrote: The Teensy++ 2.0 is a different Atmel chip (the at90usb1286), but it has all the plugins/library/samples for the Arduino IDE.
Oh, that's right.. I ordered a Teensy3 recently. That's an ARM platform, and it stuck in my head.
winhack wrote:Got it working. I needed to make one change and fix something.
Good catch on the #define. I'll have to remember that solution for future reference.

I'm glad to hear you got it working.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”