examples/button_reaction: Update for time_pulse_us() no longer raising exc.
This commit is contained in:
@@ -11,9 +11,9 @@ Ready? Cliiiiick!
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
|
||||||
delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
|
delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
|
||||||
print("You are as slow as %d microseconds!" % delay)
|
if delay < 0:
|
||||||
except OSError:
|
|
||||||
print("Well, you're *really* slow")
|
print("Well, you're *really* slow")
|
||||||
|
else:
|
||||||
|
print("You are as slow as %d microseconds!" % delay)
|
||||||
utime.sleep_ms(10)
|
utime.sleep_ms(10)
|
||||||
|
|||||||
Reference in New Issue
Block a user