const int buttonPin = 4;
const int ledPin = 12;
int buttonState = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode (ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);
Serial.println(buttonState);
if (buttonState == HIGH)
{digitalWrite(ledPin, LOW);}
else
{digitalWrite(ledPin, HIGH);}
delay(10); // this speeds up the simulation
}