summaryrefslogtreecommitdiff
path: root/examples/hwapi/button_reaction.py
diff options
context:
space:
mode:
authorGlenn Ruben Bakke <glennbakke@gmail.com>2017-02-07 22:26:13 +0100
committerGlenn Ruben Bakke <glennbakke@gmail.com>2017-02-07 22:26:13 +0100
commit4cf7fd151e98a3d842eb5c9428545cb67ddd57ee (patch)
tree947f265a2d498f4879bab3c7d19591133c56c1a0 /examples/hwapi/button_reaction.py
parent9397583f6c99533fc4c0a2753126120a8552ba4c (diff)
parent21f08524baf11e62384814b7cb8fcd2b5a8998fb (diff)
Merge branch 'master' into nrf52
Diffstat (limited to 'examples/hwapi/button_reaction.py')
-rw-r--r--examples/hwapi/button_reaction.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/hwapi/button_reaction.py b/examples/hwapi/button_reaction.py
index 5e1890d5a..b72e813e4 100644
--- a/examples/hwapi/button_reaction.py
+++ b/examples/hwapi/button_reaction.py
@@ -11,9 +11,9 @@ Ready? Cliiiiick!
""")
while 1:
- try:
- delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
- print("You are as slow as %d microseconds!" % delay)
- except OSError:
+ delay = machine.time_pulse_us(BUTTON, 1, 10*1000*1000)
+ if delay < 0:
print("Well, you're *really* slow")
+ else:
+ print("You are as slow as %d microseconds!" % delay)
utime.sleep_ms(10)