2012-12-23 17:55:59 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
Esplora Blink
|
2013-10-21 09:58:40 +02:00
|
|
|
|
2012-12-23 17:55:59 +01:00
|
|
|
This sketch blinks the Esplora's RGB LED. It goes through
|
2013-10-21 09:58:40 +02:00
|
|
|
all three primary colors (red, green, blue), then it
|
2012-12-23 17:55:59 +01:00
|
|
|
combines them for secondary colors(yellow, cyan, magenta), then
|
2013-10-21 09:58:40 +02:00
|
|
|
it turns on all the colors for white.
|
2012-12-23 17:55:59 +01:00
|
|
|
For best results cover the LED with a piece of white paper to see the colors.
|
2013-10-21 09:58:40 +02:00
|
|
|
|
2012-12-23 17:55:59 +01:00
|
|
|
Created on 22 Dec 2012
|
|
|
|
by Tom Igoe
|
2013-10-21 09:58:40 +02:00
|
|
|
|
2012-12-23 17:55:59 +01:00
|
|
|
This example is in the public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Esplora.h>
|
|
|
|
|
|
|
|
|
|
|
|
void setup() {
|
|
|
|
// There's nothing to set up for this sketch
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(255, 0, 0); // make the LED red
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(0, 255, 0); // make the LED green
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(0, 0, 255); // make the LED blue
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(255, 255, 0); // make the LED yellow
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(0, 255, 255); // make the LED cyan
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(255, 0, 255); // make the LED magenta
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
2013-10-21 09:58:40 +02:00
|
|
|
Esplora.writeRGB(255, 255, 255); // make the LED white
|
2012-12-23 17:55:59 +01:00
|
|
|
delay(1000); // wait 1 second
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|