#define Button 11
#define LED 12
int sw;
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(Button, INPUT_PULLUP);
Serial.println("Click the button:");
}
void loop()
{
sw = digitalRead(Button);
if (sw == 1)
{
digitalWrite(LED, 0);
Serial.println("LED OFF");
}
else
{
digitalWrite(LED, 1);
Serial.println("LED ON");
}
delay(1000);
}