1 |
|
---|
2 | /*
|
---|
3 | Esplora Blink
|
---|
4 |
|
---|
5 | This sketch blinks the Esplora's RGB LED. It goes through
|
---|
6 | all three primary colors (red, green, blue), then it
|
---|
7 | combines them for secondary colors(yellow, cyan, magenta), then
|
---|
8 | it turns on all the colors for white.
|
---|
9 | For best results cover the LED with a piece of white paper to see the colors.
|
---|
10 |
|
---|
11 | Created on 22 Dec 2012
|
---|
12 | by Tom Igoe
|
---|
13 |
|
---|
14 | This example is in the public domain.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #include <Esplora.h>
|
---|
18 |
|
---|
19 |
|
---|
20 | void setup() {
|
---|
21 | // There's nothing to set up for this sketch
|
---|
22 | }
|
---|
23 |
|
---|
24 | void loop() {
|
---|
25 | Esplora.writeRGB(255, 0, 0); // make the LED red
|
---|
26 | delay(1000); // wait 1 second
|
---|
27 | Esplora.writeRGB(0, 255, 0); // make the LED green
|
---|
28 | delay(1000); // wait 1 second
|
---|
29 | Esplora.writeRGB(0, 0, 255); // make the LED blue
|
---|
30 | delay(1000); // wait 1 second
|
---|
31 | Esplora.writeRGB(255, 255, 0); // make the LED yellow
|
---|
32 | delay(1000); // wait 1 second
|
---|
33 | Esplora.writeRGB(0, 255, 255); // make the LED cyan
|
---|
34 | delay(1000); // wait 1 second
|
---|
35 | Esplora.writeRGB(255, 0, 255); // make the LED magenta
|
---|
36 | delay(1000); // wait 1 second
|
---|
37 | Esplora.writeRGB(255, 255, 255); // make the LED white
|
---|
38 | delay(1000); // wait 1 second
|
---|
39 |
|
---|
40 | }
|
---|
41 |
|
---|
42 |
|
---|