In progress Halloween – PART 2

Hi Guys!

Here is a little insight into how my Halloween costume is going.

The soldering of the Neopixels was harder then I had expected and, with having to leave town this weekend for family needs, I needed to adjust my end plans and make my LED circuit into a glowing neck pendant. I also ran into some issues with uploading code from my computer to the Gemma board (apparently the new macs need a new cord to be compatible).

Despite all of this, things were going well and I was finishing up the construction and trying to learn/understand code when… my soldering snapped.  😦

#include

#define PIN 6

#define NUM_LEDS 6

#define BRIGHTNESS 50

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
// NEO_RGBW Pixels are wired for RGBW bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

uint32_t Gold = strip.Color(255,206,0);
uint32_t Turq = strip.Color(41,196,204);
uint32_t Green = strip.Color(22,142,42);
uint32_t White = strip.Color(75,75,75);
uint32_t Blank = strip.Color(0,0,0);
uint8_t count;

void setup() {
strip.begin();
strip.show(); // initialize all pixels to “off”
}

//Main program box
void loop() {
Fade(Gold);
delay(200);
Fade(Turq);
delay(200);
Fade(Green);
delay(200);

for (count = 0; count < 5; count++) {
Snake(White);
}
delay(200);
}

// Brightness Function
void Fade(uint32_t color) {
uint16_t i, j;

//Increase brightness sub-loop
for (j = 0; j < 75; j++) {
for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, color); strip.setBrightness(j); } strip.show(); delay(50); } // Decrease brightness sub-loop for (j = 75; j > 0; j–) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.setBrightness(j);
}
strip.show();
delay(50);
}

}

// Snake Function
void Snake(uint32_t color) {
uint16_t i;

for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, Blank); //Clears pixel memory to start Snake
strip.show();
delay(25);
}
strip.setBrightness(50); //Resets brightness after Fade
//Snake loop
for (i = 0; i < strip.numPixels(); i++) {
if(i<1){
strip.setPixelColor(i, color);
strip.show();
delay(100);
}
strip.setPixelColor(i, Blank);
strip.setPixelColor(i+1, color);
strip.show();
delay(100);

}
}
I’ve included my code below to share with you all and hope that tomorrow I can fix the soldering and show you in person!

IMG_0552IMG_0555IMG_0561IMG_0562

One thought on “In progress Halloween – PART 2”

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s