Write the Arduino code and implement the program to blink an RGB LED using Arduino board
Write the Arduino code and implement the program to blink an RGB LED using Arduino board
Arduino Code
// Define RGB LED pins
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
void loop() {
// Turn on the red LED, turn off the green and blue LEDs
digitalWrite(RED_PIN, HIGH);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, LOW);
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
digitalWrite(BLUE_PIN, LOW);
// Turn on the blue LED, turn off the red and green LEDs
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, HIGH);