int red_led = 13;
int red_button = 7;
int green_led = 12;
int green_button = 3;
int blue_led = 11;
int blue_button = 5;
void setup(void)
{
pinMode(red_led, OUTPUT);
pinMode(blue_led, OUTPUT);
pinMode(green_led, OUTPUT);
pinMode(red_button, INPUT);
pinMode(green_button, INPUT);
pinMode(blue_button, INPUT);
Serial.begin(115200);
}
void loop(void)
{
if (digitalRead(red_button) == HIGH)
{
Serial.println("Clicked");
digitalWrite(red_led, HIGH);
delay(1000);
digitalWrite(red_led, LOW);
}
if (digitalRead(blue_button) == HIGH)
{
digitalWrite(blue_led, HIGH);
delay(1000);
digitalWrite(blue_led, LOW);
}
if (digitalRead(green_button) == HIGH)
{
digitalWrite(green_led, HIGH);
delay(1000);
digitalWrite(green_led, LOW);
}
}