Last active
October 21, 2019 10:02
-
-
Save techzeero/85072227ecd2eee02a70d452967e9dcf to your computer and use it in GitHub Desktop.
RGB LED with Arduino. https://techzeero.com/arduino-tutorials/how-to-use-an-rgb-led-with-arduino/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How to use an RGB LED with Arduino | |
For more details, visit: https://techzeero.com/arduino-tutorials/how-to-use-an-rgb-led-with-arduino/ | |
*/ | |
void setup() | |
{ | |
pinMode(3, OUTPUT); | |
pinMode(5, OUTPUT); | |
pinMode(6, OUTPUT); | |
} | |
void loop() | |
{ | |
digitalWrite(3, HIGH); | |
delay(500); // Wait for 500 millisecond(s) | |
digitalWrite(3, LOW); | |
digitalWrite(5, HIGH); | |
delay(500); // Wait for 500 millisecond(s) | |
digitalWrite(5, LOW); | |
digitalWrite(6, HIGH); | |
delay(500); // Wait for 500 millisecond(s) | |
digitalWrite(6, LOW); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment