Costume WIP

For this week, I’m testing out components and also tweaking code in TinkerCad.  Since my partner works in lighting, I’m trying to take advantage of his treasure trove of leftover LED strips and parts.

As I was searching through his pile, I came across a bunch of LED strips but he let me know that they probably weren’t ideal since they were meant for FastLED.  I wanted to be able to practice working with the NeoPixel library, so I decide to rule these out.  Then, we found something really special…

He had a leftover NeoPixel library-compatible LED strip that glows in different kinds of white based on the different RGB inputs as well as a gorgeous amber color that you see in the video.  I went with this because these lights felt very emotional. My hope is that once I cut them up and spread them out throughout my lining fabric, the different kinds of white and amber will show.

To quickly show me the kind of light patterns that are possible, my partner hooked it up to industry-standard mapping software, called MadMapper.   Here’s a nifty video of it below:

To test out my circuit, I turned to TinkerCad

Brilliant Curcan-Robo.png

I referenced code from a nifty website that has code for a lot of different patterns.

Here’s my code for rainbow twinkles below:

 #include 
#define PIN 6
#define NUM_LEDS 48
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
  
}

void loop() {
  TwinkleRandom(20, 100, false);
}

void TwinkleRandom(int Count, int SpeedDelay, boolean OnlyOne) {
  setAll(0,0,0);
  
  for (int i=0; i<Count; i++) {
     setPixel(random(NUM_LEDS),random(0,255),random(0,255),random(0,255));
     showStrip();
     delay(SpeedDelay);
     if(OnlyOne) { 
       setAll(0,0,0); 
     }
   }
  
  delay(SpeedDelay);
}

void showStrip() {
 #ifdef ADAFRUIT_NEOPIXEL_H 
   // NeoPixel
   strip.show();
 #endif
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
 #ifdef ADAFRUIT_NEOPIXEL_H 
   // NeoPixel
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
 #endif
 #ifndef ADAFRUIT_NEOPIXEL_H 
   // FastLED
   leds[Pixel].r = red;
   leds[Pixel].g = green;
   leds[Pixel].b = blue;
 #endif
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue); 
  }
  showStrip();
}

I had originally thought about having two separate strips coming out of different outputs so that the left and right side of the body could be doing different things, but I’ll be keeping it simple!

Here’s my To-Do for the next week:
Cut 2nd lining for coat
Cut LED Strips
Write switch into the code
Determine layout for all LEDs.  I think I will come down a bit in number of LEDs since 48 separate LEDs might be a bit much!  I may cluster some of the LEDs to reduce the number of solder joints I’ll have to make.  Still working on this part…
Sew circuit into my lining
Sew lining back into coat

I have quite a bit of work ahead but I’m really excited about this project, especially since my partner gave me really beautiful LEDs to work with.

3 thoughts on “Costume WIP”

Comments are closed.