#define LED_pin 26
#define BOTTON_pin 4
int BOTTON_state=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(LED_pin, OUTPUT);
pinMode(BOTTON_pin, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
//delay(100); // this speeds up the simulation
BOTTON_state =digitalRead(BOTTON_pin);
//Serial.println(BOTTON_state);
if(BOTTON_state != HIGH)
{
digitalWrite(LED_pin, HIGH);
Serial.println("LED ON");
}
else
{
digitalWrite(LED_pin, LOW);
Serial.println("LED OFF");
}
delay(100);
}