void setup() {
// put your setup code here, to run once:
pinMode(12, OUTPUT);
pinMode(3, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int x = digitalRead(3);
if(x==0){
digitalWrite(12, HIGH);
Serial.println("Switch ON , LED ON");
}else{
digitalWrite(12, LOW);
Serial.println("Switch OFF , LED OFF");
}
}