I based this assignment off of my idea for assignment 6. The person starts off “asleep,” or lying down. When the photoresistor detects an increase of light, the person “wakes up,” sitting up. The person can wake up in two different states, however. If the photoresistor detects a lot of light, the person wakes up angry, and his eyes are red. If the photoresistor detects more moderate amounts of light, the person wakes up happy, and his eyes are green. The program resets itself automatically after 5 seconds.
The construction is simple enough. You’ll need:
19 Gauge Wire
3 LEDs (Green, Red, White)
Jumper wires, various resistors
Just attach a short (2″-3″) piece of wire to the servo, and embed the servo into a wall of foamcore. Cut out a chipboard person, including holes for the eyes, and hot glue it to the wire. I found that by adding a second wall of foamcore closer to the chipboard person, I could ensure that the LEDs would only shine through the chipboard person’s eyes, and would not create a “halo” around the chipboard person’s head.
Here’s my code: http://code.arc.cmu.edu/~cheng/uploads/HW_8b.pde