Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

MicroPython • Re: Latching High?

$
0
0
The way your code is written it will only print 1's !?

Try:

Code:

import machineimport timebutton = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_DOWN)while True:    print(button.value())    time.sleep(0.5)

Statistics: Posted by rpiMike — Sun Dec 29, 2024 3:49 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles