I wore this LED T-Shirt under nice white shirt to teach the class at Hawaii STEM Conference.
It is an 8x10 array of individually addressable LEDs (HL1606 strip from +Adafruit Industries ) driven by PJRC Teensy 2.0 and 4 D-cell batteries, with a Pololu Step-Down Voltage Regulator D15V70F5S3 to keep it at 5vdc. Current code is the Basic Pattern sketch from example lib, with mod from AdaVision's Processing script to deal with zig-zag wiring. The PWM lib mod works too, but there were more examples for this. Adding other effects (like a beating heart, or other animations) is simple matter of programming. Comms & sensors would be cool too... someday.
LED strips in T-Shirt
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- isdale
- Posts: 80
- Joined: Wed Dec 15, 2010 12:54 am
Re: LED strips in T-Shirt
Code for this was created from mashup of the HL1606 library and WS2801.java from AdaVision. I renamed the HL1606 to HL1606Matrix and added in a setZigZag() from WS2801. Code bases have different licenses so I'm not sure best way to release any code.
The original ZigZag code uses an array to map from the linear led index into a Pixel vector representing the matrix. I needed to map the other way. Rather than hurt my brain trying to figure out the math (at 2am the day before I was going to wear it), I did a quick hack - use the original WS2801 code to create mapping, use that to fill leds[] that maps the led idx, then copy that over the matrix map. Lastly it zeros out the leds[] again...
One oddity in development - Originally, the setZigZag() did the malloc() for the remapMatrx[], but this gave me compiler errors from Arduino IDE. Moving the malloc() to the object creation method removed the error, at cost of forcing dual array creation.. not really an issue since anyone not wanting it should really be using the straight HL1606 library.
Thanks Phillip for the adavision and HL1606 code.
The original ZigZag code uses an array to map from the linear led index into a Pixel vector representing the matrix. I needed to map the other way. Rather than hurt my brain trying to figure out the math (at 2am the day before I was going to wear it), I did a quick hack - use the original WS2801 code to create mapping, use that to fill leds[] that maps the led idx, then copy that over the matrix map. Lastly it zeros out the leds[] again...
Code: Select all
for (i = 0; i < _numLEDs; i++)
{
_leds[_remapMatrix[i]] = i;
}
for (i = 0; i < _numLEDs; i++)
{
_remapMatrix[i] = _leds[i];
}
for (i = 0; i < _numLEDs; i++)
{
_leds[i] = 0;
}
Thanks Phillip for the adavision and HL1606 code.
- isdale
- Posts: 80
- Joined: Wed Dec 15, 2010 12:54 am
Re: LED strips in T-Shirt
I just posted a full writeup on the T-Shirt and the STEM Conf class on the MauiMakers blog At some point I'd like to clear up licensing and release the code.
Please be positive and constructive with your questions and comments.