/* * Basic homework solution for Smartsurfaces 9/18/2009. * * */ int redPin = 12; // Red LED connected to digital pin 12 int greenPin = 11; // Green LED connected to digital pin 11 int bluePin = 10; // Blue LED connected to digital pin 10 void setup() // run once, when the sketch starts { pinMode(redPin, OUTPUT); // sets the digital pin as output pinMode(greenPin, OUTPUT); // sets the digital pin as output pinMode(bluePin, OUTPUT); // sets the digital pin as output } void loop() // run over and over again { digitalWrite(redPin, HIGH); // sets the Red LED on digitalWrite(greenPin, HIGH); // sets the Green LED on digitalWrite(bluePin, HIGH); // sets the Blue LED on delay(500); // waits for half a second digitalWrite(redPin, LOW); // sets the Red LED off digitalWrite(greenPin, LOW); // sets the Green LED off digitalWrite(bluePin, LOW); // sets the Blue LED off delay(500); // waits for half a second } Now, customize the code for your lamp and make a paper shade for it. |