rom machine import Pin
from utime import sleep
RLed = Pin(23 ,Pin.OUT)
GLed = Pin(22 ,Pin.OUT)
Btn = Pin(21 , Pin.IN)
print("Hello, ESP32!")
while True:
x = Btn.value()
if (x > 0):
RLed.off()
GLed.on()
sleep(3)
GLed.off()
else:
RLed.on()