For the first assignment of embedding LEDs and switches in clothing, I chose to make a hat with a built in turn signal.
Two red LEDs were used, each placed in on the back of the hat, one on the left side of the wearer’s head and one on the right side. Throwing the switch to the left or right causes the corresponding left or right LED to blink, thus signaling to those behind the wearer the direction the wearer intends to turn.
A 3-position toggle switch activates the LEDs. A piece of plastic is attached to the switch to create a turn signal lever, like one might find in a car or truck. For example, In the configuration shown to the left, pushing the lever away from the wearer moves the switch to the wearer’s right, thus causing the right LED to blink. Moving the switch to the center position turns the LED off.
The circuit is based on the switch with pull-up resistor example done in class. The left and right pins of the switch are each connected to their own digital pin on the Arduino, and each LED is connected to its own digital pin as well. The program that runs the hat checks if a digital input is HIGH or LOW, and either turns off the LED or begins the LED blinking cycle. Click here to download the code used to control the turn signal hat (.pde file for arduino)
See below for a few more pictures of the hat.