Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CPX_Simon_Game/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,32 @@ def read_region(timeout=30):
while time.time() - start_time < timeout:
if cpx.touch_A1:
val = PAD_REGION['A1']
time.sleep(.3)
break
elif cpx.touch_A2:
val = PAD_REGION['A2']
time.sleep(.3)
break
elif cpx.touch_A3:
val = PAD_REGION['A3']
time.sleep(.3)
break
elif cpx.touch_A4:
val = PAD_REGION['A4']
time.sleep(.3)
break
elif cpx.touch_A5:
val = PAD_REGION['A5']
time.sleep(.3)
break
elif cpx.touch_A6:
val = PAD_REGION['A6']
time.sleep(.3)
break
elif cpx.touch_A7:
val = PAD_REGION['A7']
time.sleep(.3)
break
return val

def play_sequence(sequence):
Expand Down
2 changes: 1 addition & 1 deletion Circuit_Playground_Express_IR_Treasure_Hunt/CPX_Hunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Try and decode them
try:
# Attempt to convert received pulses into numbers
received_code = tuple(decoder.decode_bits(pulses, debug=False))
received_code = tuple(decoder.decode_bits(pulses))
except adafruit_irremote.IRNECRepeatException:
# We got an unusual short code, probably a 'repeat' signal
# print("NEC repeat!")
Expand Down