// Pin definitions
const int redPin = 3;
const int greenPin = 5;
const int bluePin = 6;
const int redButton = 8;
const int greenButton = 9;
const int blueButton = 10;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(redButton, INPUT_PULLUP);
pinMode(greenButton, INPUT_PULLUP);
pinMode(blueButton, INPUT_PULLUP);
}
void loop() {
if (digitalRead(redButton) == LOW) {
digitalWrite(redPin, HIGH);
delay(1000);
digitalWrite(redPin, LOW);
delay(200);
}
if (digitalRead(greenButton) == LOW) {
digitalWrite(greenPin, HIGH);
delay(1000);
digitalWrite(greenPin, LOW);
delay(200);
}
if (digitalRead(blueButton) == LOW) {
digitalWrite(bluePin, HIGH);
delay(1000);
digitalWrite(bluePin, LOW);
delay(200);
}
}