#define R 12
#define SW1_PIN 7
#define SW2_PIN 6
void setup()
{
Serial.begin(9600);
Serial.println("Press SW1 to ON");
Serial.println("Press SW2 to OFF");
pinMode(R, OUTPUT);
pinMode(SW1_PIN, INPUT_PULLUP);
pinMode(SW2_PIN, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(SW1_PIN)==LOW) {
digitalWrite(R,HIGH);
Serial.println("LED is ON");
delay(250);
}
else if (digitalRead(SW2_PIN)==LOW) {
digitalWrite(R, LOW);
Serial.println("LED is OFF");
delay(250);
}
}