#define button 4
#define led 2
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(button, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//delay(10); // this speeds up the simulation
int Val = digitalRead(button);
Serial.print("Value = ");
Serial.println(Val);
if(Val == 1){
digitalWrite(led, LOW);
}
else {
digitalWrite(led, HIGH);
}
delay(1000);
}