from machine import Pin
from time import sleep
led = Pin(18,Pin.OUT)
botao = Pin(5,Pin.IN, Pin.PULL_UP)
while True:
valor_botao = botao.value()
print ("Valor botão: ", valor_botao)
if valor_botao == 0:
print ("Botão Pressionado!")
led.value(1)
while (botao.value() == 0):
sleep (0.2)
led.value(0)
sleep(0.2)