M
M
Majid Aziev2020-05-14 21:41:37
Arduino
Majid Aziev, 2020-05-14 21:41:37

How to track button click on pyfirmata?

How to track button click on pyfirmata?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-05-14
@Python__exe

from pyfirmata import Arduino, util
from time import sleep
board = Arduino('/dev/tty.usbserial-A6008rIF')
while True:
    if board.digital[13].read(): #кнопка на +5в с притяжкой к земле
        print("Button is pressed")
    sleep(0.5)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question