Skip to content

Commit

Permalink
GD32V: examples/BlinkRGB: add all combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
scpcom committed Nov 22, 2020
1 parent 8feee87 commit b361314
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions libraries/GD32V/examples/BlinkRGB/BlinkRGB.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
modified 15 Nov 2020
by SCP
This example code is in the public domain.
Expand All @@ -35,13 +37,39 @@ void setup() {

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BLUE, LOW); // turn the LED off by making the voltage LOW
digitalWrite(LED_RED, HIGH); // turn the LED on (HIGH is the voltage level)
/* one color */
digitalWrite(LED_RED, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_RED, LOW); // turn the LED off by making the voltage LOW
digitalWrite(LED_GREEN, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_GREEN, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_GREEN, LOW); // turn the LED off by making the voltage LOW
digitalWrite(LED_BLUE, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_BLUE, LOW); // turn the LED on by making the voltage LOW
delay(1000); // wait for a second
/* two colors */
digitalWrite(LED_RED, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_GREEN, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_GREEN, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_BLUE, LOW); // turn the LED on by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(LED_RED, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_BLUE, LOW); // turn the LED on by making the voltage LOW
delay(1000); // wait for a second
/* all colors */
digitalWrite(LED_RED, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_GREEN, LOW); // turn the LED on by making the voltage LOW
digitalWrite(LED_BLUE, LOW); // turn the LED on by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(LED_RED, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_GREEN, HIGH); // turn the LED off (HIGH is the voltage level)
digitalWrite(LED_BLUE, HIGH); // turn the LED off (HIGH is the voltage level)
delay(1000); // wait for a second
}

0 comments on commit b361314

Please sign in to comment.