1 parent d5e9ab6 commit a4a439cCopy full SHA for a4a439c
1 file changed
examples/hwapi/button_reaction.py
@@ -11,9 +11,9 @@
11
""")
12
13
while 1:
14
- try:
15
- delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
16
- print("You are as slow as %d microseconds!" % delay)
17
- except OSError:
+ delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
+ if delay < 0:
18
print("Well, you're *really* slow")
+ else:
+ print("You are as slow as %d microseconds!" % delay)
19
utime.sleep_ms(10)
0 commit comments