#Resistor interno em pull up
#Uma conexão é feita ao GND(1), outra conexão ao GPIO(2).
#Quando o botão não está pressionado, seu valor inicial é 1.
#Atribuir pinos aos componentes
from machine import Pin
from utime import sleep
botazul = Pin(15, Pin.IN, Pin.PULL_UP)
botred = Pin(28, Pin.IN, Pin.PULL_DOWN)
while True:
if botazul.value() == 1:
print('Aguardando pressionar o botão azul')
else:
print('Botão pressionado')
sleep(1)