As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Tuesday, June 11, 2013

Maddie + Candice // Final Video





Here is our video demonstration of the Arduino-powered motion-sensing bubble machine in action. Using a PIR sensor connected to an electronic toy called "The One and Only Gazillion Bubbles" we set up the bubble machine inside a small room where users would enter and activate the motion sensor. 










int pirPin = 4; // digital pin 4 for PIR; put a 10k Ohm resistor between pin 4 and OUT on PIR
int ledPin = 7; // digital pin 13 for LED; put a 220 Ohm resistor between pin 13 and the LED
int noMotion = 1;
int TIP120pin = 9; //for this project, I pick Arduino's PMW pin 11
void setup() {
pinMode(pirPin, INPUT); // set PIR pin as input
pinMode(ledPin, OUTPUT); // set LED pin as output
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
}
void loop() {
int movementSensor=digitalRead(pirPin);

if(movementSensor == HIGH) {
// motion detected
if (noMotion == 0) {
// make bubbles only if coming from a state of no motion
digitalWrite(TIP120pin, HIGH);
digitalWrite(ledPin, HIGH);

noMotion=1;
}
} else {
// No motion
digitalWrite(TIP120pin, LOW);
digitalWrite(ledPin, LOW);
noMotion=0;
}
}

No comments:

Post a Comment