from machine import Pin
from time import sleep
print('Wokwi ESP32 Simulator')
led = Pin(2, Pin.OUT) # D2 number in is Output
push_button = Pin(13, Pin.IN) # D13 number pin is input
while True:
logic_state = push_button.value()
if logic_state == True: # if pressed the push_button
led.value(1) # led will turn ON
else: # if push_button not pressed
led.value(0) # led will turn OFF