LED strips in T-Shirt
Moderators: adafruit_support_bill, adafruit

LED strips in T-Shirt

by MauiMaker on Sun Apr 01, 2012 8:30 pm

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 T-Shirt Rainbow Party tiny.jpg
LED T-Shirt running Rainbow Party
LED T-Shirt Rainbow Party tiny.jpg (51.52 KiB) Viewed 2008 times

LED T-shirt insde tiny.jpg
Inside T-Shirt
LED T-shirt insde tiny.jpg (32.34 KiB) Viewed 2008 times

LED T-Shirt Electronics tiny.jpg
T-Shirt electronics
LED T-Shirt Electronics tiny.jpg (40.71 KiB) Viewed 2008 times
Jerry Isdale
Maui Makers
http://mauiMakers.com
MauiMaker
 
Posts: 58
Joined: Wed Dec 15, 2010 12:54 am
Location: Haiku, Maui Hawaii USA

Re: LED strips in T-Shirt

by MauiMaker on Sun Apr 01, 2012 9:40 pm

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...
Code: Select all | TOGGLE FULL SIZE
   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;
   }


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.
Jerry Isdale
Maui Makers
http://mauiMakers.com
MauiMaker
 
Posts: 58
Joined: Wed Dec 15, 2010 12:54 am
Location: Haiku, Maui Hawaii USA

Re: LED strips in T-Shirt

by MauiMaker on Sun Apr 08, 2012 2:58 pm

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.
Jerry Isdale
Maui Makers
http://mauiMakers.com
MauiMaker
 
Posts: 58
Joined: Wed Dec 15, 2010 12:54 am
Location: Haiku, Maui Hawaii USA