import time
import machine
from machine import Pin
print("Hello, ESP32!")

led = Pin(2,Pin.OUT)
button = machine.Pin(25, machine.Pin.IN, machine.Pin.PULL_UP)
# if button pressed = 0 ,  if button not pressed 0
while True:

    print("Button state", button.value())
    time.sleep(0.1)
    if button.value() == 0 :
       led.value(1)
       time.sleep(0.5)
    else :
        led.value(0)
        time.sleep(0.5)