File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Circuit_Playground_Express_IR_Treasure_Hunt Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff 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
7690def play_sequence (sequence ):
Original file line number Diff line number Diff line change 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!")
You can’t perform that action at this time.
0 commit comments