File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Circuit_Playground_Express_IR_Treasure_Hunt
PyPortal_Quarantine_Clock Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -59,18 +59,32 @@ def read_region(timeout=30):
59
59
while time .time () - start_time < timeout :
60
60
if cpx .touch_A1 :
61
61
val = PAD_REGION ['A1' ]
62
+ time .sleep (.3 )
63
+ break
62
64
elif cpx .touch_A2 :
63
65
val = PAD_REGION ['A2' ]
66
+ time .sleep (.3 )
67
+ break
64
68
elif cpx .touch_A3 :
65
69
val = PAD_REGION ['A3' ]
70
+ time .sleep (.3 )
71
+ break
66
72
elif cpx .touch_A4 :
67
73
val = PAD_REGION ['A4' ]
74
+ time .sleep (.3 )
75
+ break
68
76
elif cpx .touch_A5 :
69
77
val = PAD_REGION ['A5' ]
78
+ time .sleep (.3 )
79
+ break
70
80
elif cpx .touch_A6 :
71
81
val = PAD_REGION ['A6' ]
82
+ time .sleep (.3 )
83
+ break
72
84
elif cpx .touch_A7 :
73
85
val = PAD_REGION ['A7' ]
86
+ time .sleep (.3 )
87
+ break
74
88
return val
75
89
76
90
def play_sequence (sequence ):
Original file line number Diff line number Diff line change 31
31
# Try and decode them
32
32
try :
33
33
# 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 ))
35
35
except adafruit_irremote .IRNECRepeatException :
36
36
# We got an unusual short code, probably a 'repeat' signal
37
37
# print("NEC repeat!")
Original file line number Diff line number Diff line change 95
95
refresh_time = time .monotonic ()
96
96
# set the_time
97
97
the_time = time .localtime ()
98
- except (ValueError , RuntimeError ) as error :
98
+ except (ValueError , RuntimeError ) as e :
99
99
print ("Failed to get data, retrying\n " , e )
100
100
esp .reset ()
101
101
continue
Original file line number Diff line number Diff line change 115
115
refresh_time = time .monotonic ()
116
116
# set the_time
117
117
the_time = time .localtime ()
118
- except (ValueError , RuntimeError ) as error :
118
+ except (ValueError , RuntimeError ) as e :
119
119
print ("Failed to get data, retrying\n " , e )
120
120
esp .reset ()
121
121
continue
You can’t perform that action at this time.
0 commit comments