Skip to content

Commit fc48cd4

Browse files
authored
Merge branch 'master' into master
2 parents e31f3f0 + 5ed1219 commit fc48cd4

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

CPB_ANCS/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"com.apple.mobilephone": "/ancs_phone.bmp"
3535
}
3636

37-
BLACKLIST = []
37+
BLOCKLIST = []
3838
DELAY_AFTER_PRESS = 15
3939
DEBOUNCE = 0.1
4040
DIM_TIMEOUT = 20 # Amount of timeout to turn off backlight
@@ -123,7 +123,7 @@ def wrap_in_tilegrid(open_file):
123123
current_notifications = notification_service.active_notifications
124124
for notif_id in current_notifications:
125125
notification = current_notifications[notif_id]
126-
if notification.app_id not in APP_ICONS or notification.app_id in BLACKLIST:
126+
if notification.app_id not in APP_ICONS or notification.app_id in BLOCKLIST:
127127
continue
128128
all_ids.append(notif_id)
129129

Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_AudioSine.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
audio = AudioOut(board.SPEAKER)
3535
sine_wave_sample = RawSample(sine_wave)
3636

37-
audio.play(sine_wave_sample, loop=True) # Keep playing the sample over and over
38-
time.sleep(1) # until...
39-
audio.stop() # We tell the board to stop
37+
# A single sine wave sample is hundredths of a second long. If you set loop=False, it will play
38+
# a single instance of the sample (a quick burst of sound) and then silence for the rest of the
39+
# duration of the time.sleep(). If loop=True, it will play the single instance of the sample
40+
# continuously for the duration of the time.sleep().
41+
audio.play(sine_wave_sample, loop=True) # Play the single sine_wave sample continuously...
42+
time.sleep(1) # for the duration of the sleep (in seconds)
43+
audio.stop() # and then stop.

PyPortal_EZ_Make_Oven/code.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from adafruit_mcp9600 import MCP9600
1717

1818
TITLE = "EZ Make Oven Controller"
19-
VERSION = "1.0.1"
19+
VERSION = "1.1.0"
2020

2121
print(TITLE, "version ", VERSION)
2222
time.sleep(2)
@@ -248,7 +248,7 @@ def enable(self, enable):
248248
class Graph(object):
249249
def __init__(self):
250250
self.xmin = 0
251-
self.xmax = 360
251+
self.xmax = 720 # graph up to 12 minutes
252252
self.ymin = 0
253253
self.ymax = 240
254254
self.xstart = 0
@@ -303,6 +303,9 @@ def draw_line(self, x1, y1, x2, y2, size=PROFILE_SIZE, color=1, style=1):
303303

304304
def draw_graph_point(self, x, y, size=PROFILE_SIZE, color=1):
305305
""" draw point using graph coordinates """
306+
307+
# wrap around graph point when x goes out of bounds
308+
x = (x - self.xmin) % (self.xmax - self.xmin) + self.xmin
306309
xx = (self.xstart + self.width * (x - self.xmin)
307310
// (self.xmax - self.xmin))
308311
yy = (self.ystart + int(self.height * (y - self.ymin)
@@ -418,8 +421,12 @@ def format_time(seconds):
418421
oven = ReflowOvenControl(board.D4)
419422
print("melting point: ", oven.sprofile["melting_point"])
420423
font1 = bitmap_font.load_font("/fonts/OpenSans-9.bdf")
424+
font1.load_glyphs(b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/:')
421425
font2 = bitmap_font.load_font("/fonts/OpenSans-12.bdf")
426+
font2.load_glyphs(b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/:')
422427
font3 = bitmap_font.load_font("/fonts/OpenSans-16.bdf")
428+
font3.load_glyphs(b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/:')
429+
423430

424431
label_reflow = label.Label(font1, text="", max_glyphs=10,
425432
color=LABEL_COLOR, line_spacing=0)
@@ -477,8 +484,8 @@ def format_time(seconds):
477484

478485
sgraph.xstart = 100
479486
sgraph.ystart = 4
480-
sgraph.width = 216
481-
sgraph.height = 160
487+
sgraph.width = WIDTH - sgraph.xstart - 4 # 216 for standard PyPortal
488+
sgraph.height = HEIGHT - 80 # 160 for standard PyPortal
482489
sgraph.xmin = oven.sprofile["time_range"][0]
483490
sgraph.xmax = oven.sprofile["time_range"][1]
484491
sgraph.ymin = oven.sprofile["temp_range"][0]
@@ -488,7 +495,7 @@ def format_time(seconds):
488495
draw_profile(sgraph, oven.sprofile)
489496
buttons = []
490497
if oven.sensor_status:
491-
button = Button(x=0, y=200, width=80, height=40,
498+
button = Button(x=0, y=HEIGHT-40, width=80, height=40,
492499
label="Start", label_font=font2)
493500
buttons.append(button)
494501

0 commit comments

Comments
 (0)