Skip to content

Commit 5c20421

Browse files
authored
Merge pull request #1071 from liltux/liltux
change read_region()
2 parents 12541a7 + 3beb328 commit 5c20421

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CPX_Simon_Game/code.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,32 @@ def read_region(timeout=30):
5959
while time.time() - start_time < timeout:
6060
if cpx.touch_A1:
6161
val = PAD_REGION['A1']
62+
time.sleep(.3)
63+
break
6264
elif cpx.touch_A2:
6365
val = PAD_REGION['A2']
66+
time.sleep(.3)
67+
break
6468
elif cpx.touch_A3:
6569
val = PAD_REGION['A3']
70+
time.sleep(.3)
71+
break
6672
elif cpx.touch_A4:
6773
val = PAD_REGION['A4']
74+
time.sleep(.3)
75+
break
6876
elif cpx.touch_A5:
6977
val = PAD_REGION['A5']
78+
time.sleep(.3)
79+
break
7080
elif cpx.touch_A6:
7181
val = PAD_REGION['A6']
82+
time.sleep(.3)
83+
break
7284
elif cpx.touch_A7:
7385
val = PAD_REGION['A7']
86+
time.sleep(.3)
87+
break
7488
return val
7589

7690
def play_sequence(sequence):

Circuit_Playground_Express_IR_Treasure_Hunt/CPX_Hunter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Try and decode them
3232
try:
3333
# Attempt to convert received pulses into numbers
34-
received_code = tuple(decoder.decode_bits(pulses, debug=False))
34+
received_code = tuple(decoder.decode_bits(pulses))
3535
except adafruit_irremote.IRNECRepeatException:
3636
# We got an unusual short code, probably a 'repeat' signal
3737
# print("NEC repeat!")

0 commit comments

Comments
 (0)