const int buttonPin = 4; // the number of the pushbutton pin
const int ledpin = 16; // the number of the pushbutton pin
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, HIGH) ;
} else{
digitalWrite(ledpin, LOW) ;
}
}