Created
July 2, 2020 10:12
-
-
Save buildcircuit/0b94dc163d94118846d66b49276df76c to your computer and use it in GitHub Desktop.
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
// include the library code: | |
#include <LiquidCrystal.h> | |
// initialize the library with the numbers of the interface pins | |
LiquidCrystal lcd(13, 12, 10, 9, 8, 7); | |
int REDLED = 3; // the PWM pin the LED is attached to | |
int BLUELED = 5; | |
int GREENLED= 6; | |
// the setup routine runs once when you press reset: | |
void setup() { | |
// declare pin 9 to be an output: | |
pinMode(REDLED, OUTPUT); | |
pinMode(BLUELED, OUTPUT); | |
pinMode(GREENLED, OUTPUT); | |
lcd.begin(16, 2); | |
// initialize the serial communications: | |
Serial.begin(9600); | |
lcd.write("RGB LED Flashing !"); | |
} | |
// the loop routine runs over and over again forever: | |
void loop() { | |
digitalWrite(REDLED,HIGH); | |
delay(1000); | |
digitalWrite(REDLED,LOW); | |
delay(1000); | |
digitalWrite(BLUELED,HIGH); | |
delay(1000); | |
digitalWrite(BLUELED,LOW); | |
delay(1000); | |
digitalWrite(GREENLED,HIGH); | |
delay(1000); | |
digitalWrite(GREENLED,LOW); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment