last batch in this pass
This commit is contained in:
parent
d76cd68e00
commit
f770ad0e30
27 changed files with 31 additions and 31 deletions
|
|
@ -102,7 +102,7 @@ main_group = displayio.Group()
|
||||||
for x in display_objects:
|
for x in display_objects:
|
||||||
main_group.append(x)
|
main_group.append(x)
|
||||||
|
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# convert UTC time to local timezone
|
# convert UTC time to local timezone
|
||||||
def utc_to_local(utc_dt):
|
def utc_to_local(utc_dt):
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ group.append(temp_text)
|
||||||
group.append(humid_text)
|
group.append(humid_text)
|
||||||
group.append(press_text)
|
group.append(press_text)
|
||||||
group.append(time_text)
|
group.append(time_text)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
# clock to count down to sending data to Azure
|
# clock to count down to sending data to Azure
|
||||||
azure_clock = 500
|
azure_clock = 500
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ for line in blm_font:
|
||||||
g.append(line)
|
g.append(line)
|
||||||
for line in names_font:
|
for line in names_font:
|
||||||
g.append(line)
|
g.append(line)
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ framebuffer = sharpdisplay.SharpMemoryFramebuffer(bus, chip_select_pin, 400, 240
|
||||||
display = framebufferio.FramebufferDisplay(framebuffer)
|
display = framebufferio.FramebufferDisplay(framebuffer)
|
||||||
|
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
|
|
||||||
# Set up PWM LEDs
|
# Set up PWM LEDs
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ group = displayio.Group()
|
||||||
group.append(heart)
|
group.append(heart)
|
||||||
group.append(line1)
|
group.append(line1)
|
||||||
group.append(line2)
|
group.append(line2)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
def update_heart(message, heart_color):
|
def update_heart(message, heart_color):
|
||||||
# turn off auto refresh while we change some things
|
# turn off auto refresh while we change some things
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ group = displayio.Group()
|
||||||
group.append(heart)
|
group.append(heart)
|
||||||
group.append(line1)
|
group.append(line1)
|
||||||
group.append(line2)
|
group.append(line2)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# turn off auto refresh while we change some things
|
# turn off auto refresh while we change some things
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ group = displayio.Group()
|
||||||
group.append(heart)
|
group.append(heart)
|
||||||
group.append(line1)
|
group.append(line1)
|
||||||
group.append(line2)
|
group.append(line2)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
def update_heart(message, heart_color):
|
def update_heart(message, heart_color):
|
||||||
# turn off auto refresh while we change some things
|
# turn off auto refresh while we change some things
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ group = displayio.Group()
|
||||||
group.append(heart)
|
group.append(heart)
|
||||||
group.append(line1)
|
group.append(line1)
|
||||||
group.append(line2)
|
group.append(line2)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# turn off auto refresh while we change some things
|
# turn off auto refresh while we change some things
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ melody_tempo = 0.02
|
||||||
# setup TFT Gizmo and main display group (splash)
|
# setup TFT Gizmo and main display group (splash)
|
||||||
display = tft_gizmo.TFT_Gizmo()
|
display = tft_gizmo.TFT_Gizmo()
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
# load dreidel background image
|
# load dreidel background image
|
||||||
dreidel_bmp, dreidel_pal = adafruit_imageload.load("/dreidel_background.bmp",
|
dreidel_bmp, dreidel_pal = adafruit_imageload.load("/dreidel_background.bmp",
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ splash = displayio.Group()
|
||||||
splash.append(background)
|
splash.append(background)
|
||||||
splash.append(flakes)
|
splash.append(flakes)
|
||||||
splash.append(snow)
|
splash.append(snow)
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
def clear_the_snow():
|
def clear_the_snow():
|
||||||
#pylint: disable=global-statement, redefined-outer-name
|
#pylint: disable=global-statement, redefined-outer-name
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ splash = displayio.Group()
|
||||||
splash.append(background)
|
splash.append(background)
|
||||||
splash.append(flakes)
|
splash.append(flakes)
|
||||||
splash.append(snow)
|
splash.append(snow)
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
def clear_the_snow():
|
def clear_the_snow():
|
||||||
#pylint: disable=global-statement, redefined-outer-name
|
#pylint: disable=global-statement, redefined-outer-name
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ sprite.x = 16 * player_loc["x"]
|
||||||
sprite.y = 16 * player_loc["y"]
|
sprite.y = 16 * player_loc["y"]
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
prev_btn_vals = ugame.buttons.get_pressed()
|
prev_btn_vals = ugame.buttons.get_pressed()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ sprite.x = 16 * player_loc["x"]
|
||||||
sprite.y = 16 * player_loc["y"]
|
sprite.y = 16 * player_loc["y"]
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
prev_btn_vals = ugame.buttons.get_pressed()
|
prev_btn_vals = ugame.buttons.get_pressed()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,6 @@ sprite.x = 16 * 4
|
||||||
sprite.y = 16 * 3
|
sprite.y = 16 * 3
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
while True:
|
while True:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,7 @@ print("loading map")
|
||||||
load_map(MAPS[GAME_STATE["MAP_INDEX"]])
|
load_map(MAPS[GAME_STATE["MAP_INDEX"]])
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
# variables to store previous value of button state
|
# variables to store previous value of button state
|
||||||
prev_up = False
|
prev_up = False
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ def scroll(line):
|
||||||
g = displayio.Group()
|
g = displayio.Group()
|
||||||
g.append(line1)
|
g.append(line1)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
wavs = []
|
wavs = []
|
||||||
for filename in os.listdir('/tomb_sounds'):
|
for filename in os.listdir('/tomb_sounds'):
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ timer_label.y = 114
|
||||||
text_group.append(timer_label)
|
text_group.append(timer_label)
|
||||||
|
|
||||||
clue_display.append(text_group)
|
clue_display.append(text_group)
|
||||||
clue.display.show(clue_display)
|
clue.display.root_group = clue_display
|
||||||
|
|
||||||
# Define color Palettes
|
# Define color Palettes
|
||||||
waterPalette = [0x00d9ff, 0x006f82, 0x43bfb9, 0x0066ff]
|
waterPalette = [0x00d9ff, 0x006f82, 0x43bfb9, 0x0066ff]
|
||||||
|
|
@ -231,7 +231,7 @@ while True:
|
||||||
reading2_label.text = "Last {:.1f}".format(reading2)
|
reading2_label.text = "Last {:.1f}".format(reading2)
|
||||||
reading3_label.text = "Prev {:.1f}".format(reading3)
|
reading3_label.text = "Prev {:.1f}".format(reading3)
|
||||||
timer_label.text = "{}".format(counter)
|
timer_label.text = "{}".format(counter)
|
||||||
clue.display.show(clue_display)
|
clue.display.root_group = clue_display
|
||||||
|
|
||||||
# Is it time to update?
|
# Is it time to update?
|
||||||
if counter > timeToCheck:
|
if counter > timeToCheck:
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ display = ST7789(
|
||||||
)
|
)
|
||||||
|
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
for output_line in shell_command(listen_command):
|
for output_line in shell_command(listen_command):
|
||||||
process_output(output_line)
|
process_output(output_line)
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ orange_dark = 0x472a16
|
||||||
|
|
||||||
# display
|
# display
|
||||||
main_display_group = displayio.Group() # everything goes in main group
|
main_display_group = displayio.Group() # everything goes in main group
|
||||||
display.show(main_display_group) # show main group (clears screen, too)
|
display.root_group = main_display_group # show main group (clears screen, too)
|
||||||
|
|
||||||
# background bitmap w OnDiskBitmap
|
# background bitmap w OnDiskBitmap
|
||||||
tape_bitmap = displayio.OnDiskBitmap(open("mp3_tape.bmp", "rb"))
|
tape_bitmap = displayio.OnDiskBitmap(open("mp3_tape.bmp", "rb"))
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class OpenWeather_Graphics(displayio.Group):
|
||||||
# bg_sprite = displayio.TileGrid(background, pixel_shader=background.pixel_shader)
|
# bg_sprite = displayio.TileGrid(background, pixel_shader=background.pixel_shader)
|
||||||
|
|
||||||
splash.append(bg_sprite)
|
splash.append(bg_sprite)
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
self.root_group = displayio.Group()
|
self.root_group = displayio.Group()
|
||||||
self.root_group.append(self)
|
self.root_group.append(self)
|
||||||
|
|
@ -155,7 +155,7 @@ class OpenWeather_Graphics(displayio.Group):
|
||||||
else:
|
else:
|
||||||
self.wind_text.text = "%d mph" % wind
|
self.wind_text.text = "%d mph" % wind
|
||||||
|
|
||||||
self.display.show(self.root_group)
|
self.display.root_group = self.root_group
|
||||||
|
|
||||||
def set_icon(self, icon_name):
|
def set_icon(self, icon_name):
|
||||||
"""Use icon_name to get the position of the sprite and update
|
"""Use icon_name to get the position of the sprite and update
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ SPRITES.append(Sprite(EYE_DATA["eye_image"])) # Base image is opaque
|
||||||
SPRITES.append(Sprite(EYE_DATA["lower_lid_image"], EYE_DATA["transparent"]))
|
SPRITES.append(Sprite(EYE_DATA["lower_lid_image"], EYE_DATA["transparent"]))
|
||||||
SPRITES.append(Sprite(EYE_DATA["upper_lid_image"], EYE_DATA["transparent"]))
|
SPRITES.append(Sprite(EYE_DATA["upper_lid_image"], EYE_DATA["transparent"]))
|
||||||
SPRITES.append(Sprite(EYE_DATA["stencil_image"], EYE_DATA["transparent"]))
|
SPRITES.append(Sprite(EYE_DATA["stencil_image"], EYE_DATA["transparent"]))
|
||||||
DISPLAY.show(SPRITES)
|
DISPLAY.root_group = SPRITES
|
||||||
|
|
||||||
EYE_CENTER = (
|
EYE_CENTER = (
|
||||||
(EYE_DATA["eye_move_min"][0] + EYE_DATA["eye_move_max"][0]) # Pixel coords of eye
|
(EYE_DATA["eye_move_min"][0] + EYE_DATA["eye_move_max"][0]) # Pixel coords of eye
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ with open("quotes.csv", "r", encoding="UTF-8") as F:
|
||||||
|
|
||||||
display = board.DISPLAY
|
display = board.DISPLAY
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
arial = bitmap_font.load_font("fonts/Arial-12.pcf")
|
arial = bitmap_font.load_font("fonts/Arial-12.pcf")
|
||||||
bold = bitmap_font.load_font("fonts/Arial-Bold-12.pcf")
|
bold = bitmap_font.load_font("fonts/Arial-Bold-12.pcf")
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ pyportal.set_backlight(0.5)
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
|
|
||||||
# show splash group
|
# show splash group
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
# Palette for water bitmap
|
# Palette for water bitmap
|
||||||
palette = displayio.Palette(2)
|
palette = displayio.Palette(2)
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@ class WeatherStation_GFX(displayio.Group):
|
||||||
def __init__(self, celsius=True):
|
def __init__(self, celsius=True):
|
||||||
# root displayio group
|
# root displayio group
|
||||||
root_group = displayio.Group()
|
root_group = displayio.Group()
|
||||||
board.DISPLAY.show(root_group)
|
board.DISPLAY.root_group = root_group
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._celsius = celsius
|
self._celsius = celsius
|
||||||
|
|
||||||
# create background icon group
|
# create background icon group
|
||||||
self._icon_group = displayio.Group()
|
self._icon_group = displayio.Group()
|
||||||
board.DISPLAY.show(self._icon_group)
|
board.DISPLAY.root_group = self._icon_group
|
||||||
|
|
||||||
# create text object group
|
# create text object group
|
||||||
self._text_group = displayio.Group()
|
self._text_group = displayio.Group()
|
||||||
|
|
@ -75,7 +75,7 @@ class WeatherStation_GFX(displayio.Group):
|
||||||
self.sgp_text.x = 0
|
self.sgp_text.x = 0
|
||||||
self.sgp_text.y = 155
|
self.sgp_text.y = 155
|
||||||
|
|
||||||
board.DISPLAY.show(self._text_group)
|
board.DISPLAY.root_group = self._text_group
|
||||||
|
|
||||||
def display_io_status(self, status_text):
|
def display_io_status(self, status_text):
|
||||||
"""Displays the current IO status.
|
"""Displays the current IO status.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from ulab import numpy as np
|
||||||
|
|
||||||
# Blank the screen. Scrolling text causes unwanted delays.
|
# Blank the screen. Scrolling text causes unwanted delays.
|
||||||
d = displayio.Group()
|
d = displayio.Group()
|
||||||
board.DISPLAY.show(d)
|
board.DISPLAY.root_group = d
|
||||||
|
|
||||||
# Sampling rate: 16Hz
|
# Sampling rate: 16Hz
|
||||||
# Cutoff frequency: 0.16Hz
|
# Cutoff frequency: 0.16Hz
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ from ulab import numpy as np
|
||||||
# Blank the screen. Scrolling text causes unwanted delays.
|
# Blank the screen. Scrolling text causes unwanted delays.
|
||||||
import displayio
|
import displayio
|
||||||
d = displayio.Group()
|
d = displayio.Group()
|
||||||
board.DISPLAY.show(d)
|
board.DISPLAY.root_group = d
|
||||||
|
|
||||||
# Filter computed at https://fiiir.com/
|
# Filter computed at https://fiiir.com/
|
||||||
# Sampling rate: 8Hz
|
# Sampling rate: 8Hz
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ fft_size = 256
|
||||||
group.append(graph)
|
group.append(graph)
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
# instantiate board mic
|
# instantiate board mic
|
||||||
mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
|
mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue