Introduction: Blinky Ugly Sweater

I'm a little late to the ugly sweater game, but I actually made this in December. It's very simple, just some LEDs connected to a chipKIT microcontroller.

Step 1: Planning

My sweater was pretty much just LED's connected directly to the output pins of a Fubarino Mini. I chose the board because we had a few that were unused and I like the size of the board.

Step 2: Wiring

Each LED needs a wire to the anode (+) and a single ground wire that connects to all the cathodes (-). I pushed the LEDs through the swearer where I wanted them and cut pieces of perf board to solder the wires to the LEDs. If I was thinking ahead I would have cut 2x6 pieces because there is 2 leads from the LED, the positive and 2 ground, one from the last LED and one to the next LED. You can see that there are a few extra pins set up if I wanted to add more LEDs.

Step 3: Code

That's it! Here's the code I used, it just picks a random pin, a random delay and flashes the LED for 50 milliseconds. For more projects and news about Digilent, check out or blog at blog.digilentinc.com.

int ranNum;
int ranDel;

voidsetup() {
  randomSeed (analogRead (0));    // randomize
  pinMode(31, OUTPUT);
  pinMode(30, OUTPUT);
  pinMode(29, OUTPUT);
  pinMode(28, OUTPUT);
  pinMode(27, OUTPUT);
  pinMode(26, OUTPUT);
  pinMode(25, OUTPUT);
}

voidloop() { 
  //Generate random number for pins
  ranNum=random(24,32);
  //Generate random delay
  ranDel=random(25, 75);
  delay(ranDel);
  digitalWrite(ranNum, HIGH);
  delay(50);
  digitalWrite(ranNum, LOW);   
}

Comments

author
MsSweetSatisfaction (author)2015-02-01

Daww this is adorable, I love combining wearables and technology. Looks like you had a very festive holiday season, and will probably have another next year. Welcome to instructables!