Added red LED to single-double tap code.
This commit is contained in:
parent
ee27dc9f7c
commit
b4879da5ec
1 changed files with 5 additions and 1 deletions
|
|
@ -7,16 +7,20 @@ tap_count = 0
|
|||
# We're looking for 2 single-taps before moving on.
|
||||
while tap_count < 2:
|
||||
if cpx.tapped:
|
||||
print("Single-tap!")
|
||||
tap_count += 1
|
||||
print("Reached 2 single-taps!")
|
||||
|
||||
# Now switch to checking for double-taps
|
||||
# Now switch to checking for double-taps.
|
||||
tap_count = 0
|
||||
cpx.detect_taps = 2
|
||||
|
||||
# We're looking for 2 double-taps before moving on.
|
||||
while tap_count < 2:
|
||||
if cpx.tapped:
|
||||
print("Double-tap!")
|
||||
tap_count += 1
|
||||
|
||||
print("Reached 2 double-taps!")
|
||||
cpx.red_led = True
|
||||
print("Done.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue