1919 by Arturo Guadalupi
2020 modified 8 Sep 2016
2121 by Colby Newman
22+ modified 15 Nov 2020
23+ by SCP
2224
2325 This example code is in the public domain.
2426
@@ -35,13 +37,39 @@ void setup() {
3537
3638// the loop function runs over and over again forever
3739void loop () {
38- digitalWrite (LED_BLUE, LOW); // turn the LED off by making the voltage LOW
39- digitalWrite (LED_RED, HIGH); // turn the LED on (HIGH is the voltage level)
40+ /* one color */
41+ digitalWrite (LED_RED, LOW); // turn the LED on by making the voltage LOW
42+ digitalWrite (LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
43+ digitalWrite (LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
4044 delay (1000 ); // wait for a second
41- digitalWrite (LED_RED, LOW); // turn the LED off by making the voltage LOW
42- digitalWrite (LED_GREEN, HIGH); // turn the LED on (HIGH is the voltage level)
45+ digitalWrite (LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
46+ digitalWrite (LED_GREEN, LOW); // turn the LED on by making the voltage LOW
47+ digitalWrite (LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
4348 delay (1000 ); // wait for a second
44- digitalWrite (LED_GREEN, LOW); // turn the LED off by making the voltage LOW
45- digitalWrite (LED_BLUE, HIGH); // turn the LED on (HIGH is the voltage level)
49+ digitalWrite (LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
50+ digitalWrite (LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
51+ digitalWrite (LED_BLUE, LOW); // turn the LED on by making the voltage LOW
52+ delay (1000 ); // wait for a second
53+ /* two colors */
54+ digitalWrite (LED_RED, LOW); // turn the LED on by making the voltage LOW
55+ digitalWrite (LED_GREEN, LOW); // turn the LED on by making the voltage LOW
56+ digitalWrite (LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
57+ delay (1000 ); // wait for a second
58+ digitalWrite (LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
59+ digitalWrite (LED_GREEN, LOW); // turn the LED on by making the voltage LOW
60+ digitalWrite (LED_BLUE, LOW); // turn the LED on by making the voltage LOW
61+ delay (1000 ); // wait for a second
62+ digitalWrite (LED_RED, LOW); // turn the LED on by making the voltage LOW
63+ digitalWrite (LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
64+ digitalWrite (LED_BLUE, LOW); // turn the LED on by making the voltage LOW
65+ delay (1000 ); // wait for a second
66+ /* all colors */
67+ digitalWrite (LED_RED, LOW); // turn the LED on by making the voltage LOW
68+ digitalWrite (LED_GREEN, LOW); // turn the LED on by making the voltage LOW
69+ digitalWrite (LED_BLUE, LOW); // turn the LED on by making the voltage LOW
70+ delay (1000 ); // wait for a second
71+ digitalWrite (LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
72+ digitalWrite (LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
73+ digitalWrite (LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
4674 delay (1000 ); // wait for a second
4775}
0 commit comments