from machine import Pin
from time import sleep_ms
botao = Pin(12, Pin.IN, Pin.PULL_DOWN)
antes = botao.value()
while True:
agora = botao.value()
if agora != antes:
if agora == 1:
print ("apertou!")
#else:
# print ("soltou!")
antes = agora
sleep_ms(100)Loading
esp32-devkit-c-v4
esp32-devkit-c-v4