/* Claudius Kirsch Project 'Again' CART 360: Tangible Media Instructor: Vincent Leclerc Concordia University, Fall 2008 Vote Quimby! */ //b for brightness: int b = 0; void setup() { pinMode(3, INPUT); pinMode(6, OUTPUT); pinMode(10, OUTPUT); } void loop() { //Digital value from the capacitive sensor: int sense = digitalRead(3); //triggered through the capacitive sensor: if(sense == 1) { //spin the motor at a decent speed: analogWrite(6, 70); //Fade the LEDs in: if(b < 255) { analogWrite(10, b); delay(2); b++; } } //if the sensor does not sense anymore: else { //turn off the motor: analogWrite(6, 0); if(b > 0) { //Fade out the LEDs: analogWrite(10, b); delay(5); b--; } } }