Added red LED to single-double tap code.

This commit is contained in:
Kattni Rembor 2018-05-28 15:17:16 -04:00
parent ee27dc9f7c
commit b4879da5ec

View file

@ -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.")