Write the Arduino code and implement the program to blink an RGB LED
using Arduino board .
Arduino Code
// Define RGB LED pins
#define RED_PIN 10 // Red pin connected to digital pin 10
#define GREEN_PIN 9 // Green pin connected to digital pin 9
#define BLUE_PIN 8 // Blue pin connected to digital pin 8
void setup() {
// Set RGB LED pins as outputs
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);
delay(1000); // Delay for 1 second
// Turn on the green LED, turn off the red and blue LEDs
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, HIGH);
digitalWrite(BLUE_PIN, LOW);
delay(1000); // Delay for 1 second
// Turn on the blue LED, turn off the red and green LEDs
digitalWrite(RED_PIN, LOW);
digitalWrite(GREEN_PIN, LOW);
digitalWrite(BLUE_PIN, HIGH);
delay(1000); // Delay for 1 second