const int buttonpin = 4;
const int ledpin = 5;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(buttonpin, INPUT);
Serial.println("Hello, ESP32!");
pinMode(ledpin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonstate = digitalWrite(buttonpin);
Serial println(buttonstate);
delay(10); // this speeds up the simulation
if (buttonstate == HIGH);
} else {
digitalWrite(ledpin, LOW);
}