Кто-нибудь знает, почему кнопка 2 работает, а кнопка 1 нет?
Кнопка 2 соединена с GP14 и массой Кнопка 1 соединена с GP15 и заземлена
Button1 всегда высокий
from machine import Pin
from time import sleep
motorRight = Pin(18, Pin.OUT)
motorLeft = Pin(16, Pin.OUT)
button1 = Pin(15, Pin.IN, Pin.PULL_UP)
button2 = Pin(14, Pin.IN, Pin.PULL_UP)
while True:
if not button1.value():
motorLeft.value(0)
motorRight.value(1)
print(button1.value(), "BTN: 1")
sleep(0.1)
if not button2.value():
motorRight.value(0)
motorLeft.value(1)
print(button2.value(), "BTN: 2")
sleep(0.1)