For Adafruit/Instructables "Make it Tweet" challenge, I assembled a way for an Arduino microcontroller to monitor and post updates to Twitter when the cats eat, need food, and need water. Here's an overview video:
The complete project is posted on instructables, complete with source code and schematics.
For the Radio Shack Great Create, I crafted a motion-sensitive haunted pumpkin with pulsing red eyes. When motion was detected, it would blink wildly and issue a wicked laugh. The full how-to with pictures and video is posted on instructables.
Full source code:
/* This is the source code for the motion sensitive haunted pumpkin built for Radio Shack. Original code by Daniel Gentleman, thoughtfix.com */
// Set up pin assignments int leftEye = 3; // PWM pin 3 int rightEye = 5; // PWM pin 5 int redBlink1 = 9; int redBlink2 = 10; int whiteBlink = 13; int laughBox = 12; // transistor to voice module int pirSensor = 7; // passive infrared sensors int pirState = 0; //Initial IR state
void loop () { // fade in from min to max in increments of 5 points: for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { // sets the value (range from 0 to 255): analogWrite(leftEye, fadeValue); analogWrite(rightEye, fadeValue); // wait for 30 milliseconds delay(30); } pirState = digitalRead(pirSensor); // read the state of the pirsensor value: if (pirState == HIGH){ // If motion is detected freakout(); // Call the freakout routine }
// fade out from max to min in increments of 5 points: for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { // sets the value (range from 0 to 255): analogWrite(leftEye, fadeValue); analogWrite(rightEye, fadeValue); // wait for 30 milliseconds to see the dimming effect delay(30); } pirState = digitalRead(pirSensor); // Same as above if (pirState == HIGH){ freakout(); }