batch 5
This commit is contained in:
parent
fde611205f
commit
d76cd68e00
29 changed files with 53 additions and 75 deletions
|
|
@ -57,7 +57,7 @@ display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HE
|
||||||
|
|
||||||
# default display group
|
# default display group
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
# connect to network
|
# connect to network
|
||||||
print()
|
print()
|
||||||
|
|
@ -235,7 +235,7 @@ while True:
|
||||||
#if parrot is True:
|
#if parrot is True:
|
||||||
if parrot_pin.value is True:
|
if parrot_pin.value is True:
|
||||||
# switch to party parrot display group
|
# switch to party parrot display group
|
||||||
display.show(parrot_group)
|
display.root_group = parrot_group
|
||||||
if (party + 0.1) < time.monotonic():
|
if (party + 0.1) < time.monotonic():
|
||||||
# the party parrot animation cycles
|
# the party parrot animation cycles
|
||||||
parrot_grid[0] = p
|
parrot_grid[0] = p
|
||||||
|
|
@ -245,7 +245,7 @@ while True:
|
||||||
# if it isn't a party
|
# if it isn't a party
|
||||||
else:
|
else:
|
||||||
# show default display with info
|
# show default display with info
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
# poll the server for incoming/outgoing requests
|
# poll the server for incoming/outgoing requests
|
||||||
server.poll()
|
server.poll()
|
||||||
# pylint: disable=broad-except
|
# pylint: disable=broad-except
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ switch_coordinates = [(0, 0), (1, 0), (2, 0), (3, 0),
|
||||||
midi_notes = [60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75]
|
midi_notes = [60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75]
|
||||||
|
|
||||||
# show main display GUI
|
# show main display GUI
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
|
|
@ -314,7 +314,7 @@ while True:
|
||||||
# if an arcade button is selected to change the MIDI note...
|
# if an arcade button is selected to change the MIDI note...
|
||||||
if sub_state:
|
if sub_state:
|
||||||
# display the secondary GUI menu
|
# display the secondary GUI menu
|
||||||
display.show(big_splash)
|
display.root_group = big_splash
|
||||||
# display the selected button's MIDI note
|
# display the selected button's MIDI note
|
||||||
big_text.text = str(midi_num)
|
big_text.text = str(midi_num)
|
||||||
|
|
||||||
|
|
@ -368,6 +368,6 @@ while True:
|
||||||
# update new MIDI number text label
|
# update new MIDI number text label
|
||||||
text_labels[button_pos].text = str(midi_num)
|
text_labels[button_pos].text = str(midi_num)
|
||||||
# show main GUI display
|
# show main GUI display
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
# turn off blinking LED
|
# turn off blinking LED
|
||||||
leds[button_pos].value = False
|
leds[button_pos].value = False
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ display_bus = displayio.FourWire(
|
||||||
display = ST7789(display_bus, width=280, height=240, rowstart=20, rotation=270)
|
display = ST7789(display_bus, width=280, height=240, rowstart=20, rotation=270)
|
||||||
|
|
||||||
screen = displayio.Group() # Create a Group to hold content
|
screen = displayio.Group() # Create a Group to hold content
|
||||||
display.show(screen) # Add it to the Display
|
display.root_group = screen # Add it to the Display
|
||||||
|
|
||||||
# display image
|
# display image
|
||||||
image = displayio.OnDiskBitmap("/img/bootpip0.bmp")
|
image = displayio.OnDiskBitmap("/img/bootpip0.bmp")
|
||||||
|
|
@ -43,7 +43,7 @@ if cursor_on:
|
||||||
cursor.x = 0 # hide cursor during bootup
|
cursor.x = 0 # hide cursor during bootup
|
||||||
cursor.y = 0
|
cursor.y = 0
|
||||||
|
|
||||||
display.show(screen)
|
display.root_group = screen
|
||||||
|
|
||||||
boot_file_names = [
|
boot_file_names = [
|
||||||
"/img/bootpip0.bmp",
|
"/img/bootpip0.bmp",
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ text_group.append(new_game_text)
|
||||||
group.append(text_group)
|
group.append(text_group)
|
||||||
|
|
||||||
# displaying main display group
|
# displaying main display group
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
# state for hit detection
|
# state for hit detection
|
||||||
crash = False
|
crash = False
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ pad = ShiftRegisterKeys(
|
||||||
|
|
||||||
# Make the Display Background
|
# Make the Display Background
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
board.DISPLAY.show(splash)
|
board.DISPLAY.root_group = splash
|
||||||
|
|
||||||
color_bitmap = displayio.Bitmap(160, 128, 1)
|
color_bitmap = displayio.Bitmap(160, 128, 1)
|
||||||
color_palette = displayio.Palette(1)
|
color_palette = displayio.Palette(1)
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ amg8833 = adafruit_amg88xx.AMG88XX(i2c)
|
||||||
splash = displayio.Group(scale=display.width // 160)
|
splash = displayio.Group(scale=display.width // 160)
|
||||||
bitmap = displayio.OnDiskBitmap("/thermalcamera_splash.bmp")
|
bitmap = displayio.OnDiskBitmap("/thermalcamera_splash.bmp")
|
||||||
splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader))
|
splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader))
|
||||||
board.DISPLAY.show(splash)
|
board.DISPLAY.root_group = splash
|
||||||
|
|
||||||
# Thermal sensor grid axis size; AMG8833 sensor is 8x8
|
# Thermal sensor grid axis size; AMG8833 sensor is 8x8
|
||||||
SENSOR_AXIS = 8
|
SENSOR_AXIS = 8
|
||||||
|
|
@ -381,7 +381,7 @@ orig_max_range_f = 0 # Establish temporary range variables
|
||||||
orig_min_range_f = 0
|
orig_min_range_f = 0
|
||||||
|
|
||||||
# Activate display, show preloaded sample spectrum, and play welcome tone
|
# Activate display, show preloaded sample spectrum, and play welcome tone
|
||||||
display.show(image_group)
|
display.root_group = image_group
|
||||||
update_image_frame()
|
update_image_frame()
|
||||||
flash_status("IRON", 0.75)
|
flash_status("IRON", 0.75)
|
||||||
play_tone(880, 0.010) # Musical note A5
|
play_tone(880, 0.010) # Musical note A5
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ mouse_cursor = Cursor(display, display_group=splash)
|
||||||
cursor = DebouncedCursorManager(mouse_cursor)
|
cursor = DebouncedCursorManager(mouse_cursor)
|
||||||
|
|
||||||
# Show splash group
|
# Show splash group
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
prev_btn = None
|
prev_btn = None
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
|
|
@ -35,21 +35,12 @@ amg8833 = adafruit_amg88xx.AMG88XX(i2c)
|
||||||
font = bitmap_font.load_font("/fonts/OpenSans-9.bdf")
|
font = bitmap_font.load_font("/fonts/OpenSans-9.bdf")
|
||||||
|
|
||||||
# Display splash graphics and play startup tones
|
# Display splash graphics and play startup tones
|
||||||
# CircuitPython 6 & 7 compatible
|
|
||||||
with open("/thermal_cam_splash.bmp", "rb") as bitmap_file:
|
|
||||||
bitmap = displayio.OnDiskBitmap(bitmap_file)
|
|
||||||
splash = displayio.Group()
|
|
||||||
splash.append(displayio.TileGrid(bitmap,
|
|
||||||
pixel_shader=getattr(bitmap, 'pixel_shader', displayio.ColorConverter())))
|
|
||||||
board.DISPLAY.show(splash)
|
|
||||||
time.sleep(0.1) # Allow the splash to display
|
|
||||||
|
|
||||||
# # CircuitPython 7+ compatible
|
splash = displayio.Group()
|
||||||
# splash = displayio.Group()
|
bitmap = displayio.OnDiskBitmap("/thermal_cam_splash.bmp")
|
||||||
# bitmap = displayio.OnDiskBitmap("/thermal_cam_splash.bmp")
|
splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader))
|
||||||
# splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader))
|
board.DISPLAY.root_group = splash
|
||||||
# board.DISPLAY.show(splash)
|
time.sleep(0.1) # Allow the splash to display
|
||||||
# time.sleep(0.1) # Allow the splash to display
|
|
||||||
|
|
||||||
panel.play_tone(440, 0.1) # A4
|
panel.play_tone(440, 0.1) # A4
|
||||||
panel.play_tone(880, 0.1) # A5
|
panel.play_tone(880, 0.1) # A5
|
||||||
|
|
@ -346,7 +337,7 @@ orig_max_range_f = 0 # There are no initial range values
|
||||||
orig_min_range_f = 0
|
orig_min_range_f = 0
|
||||||
|
|
||||||
# Activate display and play welcome tone
|
# Activate display and play welcome tone
|
||||||
board.DISPLAY.show(image_group)
|
board.DISPLAY.root_group = image_group
|
||||||
panel.play_tone(880, 0.1) # A5; ready to start looking
|
panel.play_tone(880, 0.1) # A5; ready to start looking
|
||||||
|
|
||||||
###--- PRIMARY PROCESS LOOP ---###
|
###--- PRIMARY PROCESS LOOP ---###
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ text_area.anchored_position = (240 / 2, 240 / 2)
|
||||||
text_area.scale = 2
|
text_area.scale = 2
|
||||||
clue_group.append(text_area)
|
clue_group.append(text_area)
|
||||||
|
|
||||||
display.show(clue_group)
|
display.root_group = clue_group
|
||||||
|
|
||||||
class RainbowFade(Animation):
|
class RainbowFade(Animation):
|
||||||
''' fades the entire strip through the whole spectrum '''
|
''' fades the entire strip through the whole spectrum '''
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class AWS_GFX(displayio.Group):
|
||||||
# root displayio group
|
# root displayio group
|
||||||
root_group = displayio.Group()
|
root_group = displayio.Group()
|
||||||
self.display = board.DISPLAY
|
self.display = board.DISPLAY
|
||||||
self.display.show(root_group)
|
self.display.root_group = root_group
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
# temperature display option
|
# temperature display option
|
||||||
|
|
@ -33,7 +33,7 @@ class AWS_GFX(displayio.Group):
|
||||||
|
|
||||||
# create background icon group
|
# create background icon group
|
||||||
self._icon_group = displayio.Group()
|
self._icon_group = displayio.Group()
|
||||||
self.display.show(self._icon_group)
|
self.display.root_group = self._icon_group
|
||||||
# create text object group
|
# create text object group
|
||||||
self._text_group = displayio.Group()
|
self._text_group = displayio.Group()
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ class AWS_GFX(displayio.Group):
|
||||||
status_group.append(self.aws_status_label)
|
status_group.append(self.aws_status_label)
|
||||||
self._text_group.append(status_group)
|
self._text_group.append(status_group)
|
||||||
|
|
||||||
self.display.show(self._text_group)
|
self.display.root_group = self._text_group
|
||||||
|
|
||||||
def show_aws_status(self, status_text):
|
def show_aws_status(self, status_text):
|
||||||
"""Displays the system status on the PyPortal
|
"""Displays the system status on the PyPortal
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class Azure_GFX(displayio.Group):
|
||||||
"""
|
"""
|
||||||
# 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__()
|
||||||
|
|
||||||
# temperature display option
|
# temperature display option
|
||||||
|
|
@ -33,7 +33,7 @@ class Azure_GFX(displayio.Group):
|
||||||
|
|
||||||
# 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()
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ class Azure_GFX(displayio.Group):
|
||||||
self._text_group.append(self.azure_status_text)
|
self._text_group.append(self.azure_status_text)
|
||||||
|
|
||||||
def show_text(self):
|
def show_text(self):
|
||||||
board.DISPLAY.show(self._text_group)
|
board.DISPLAY.root_group = self._text_group
|
||||||
|
|
||||||
def display_azure_status(self, status_text):
|
def display_azure_status(self, status_text):
|
||||||
"""Displays the system status on the PyPortal
|
"""Displays the system status on the PyPortal
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ _icons = [
|
||||||
# Make the display context.
|
# Make the display context.
|
||||||
display = board.DISPLAY
|
display = board.DISPLAY
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# Touchscreen initialization
|
# Touchscreen initialization
|
||||||
ts = adafruit_touchscreen.Touchscreen(
|
ts = adafruit_touchscreen.Touchscreen(
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ LABEL_OFFSET = 290
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
calc_group = displayio.Group()
|
calc_group = displayio.Group()
|
||||||
board.DISPLAY.show(calc_group)
|
board.DISPLAY.root_group = calc_group
|
||||||
|
|
||||||
# Make a background color fill
|
# Make a background color fill
|
||||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
calc_group = displayio.Group()
|
calc_group = displayio.Group()
|
||||||
board.DISPLAY.show(calc_group)
|
board.DISPLAY.root_group = calc_group
|
||||||
|
|
||||||
# Make a background color fill
|
# Make a background color fill
|
||||||
color_bitmap = displayio.Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT, 1)
|
color_bitmap = displayio.Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT, 1)
|
||||||
|
|
|
||||||
|
|
@ -610,7 +610,7 @@ def change_profile(oven):
|
||||||
for b in buttons:
|
for b in buttons:
|
||||||
display_group.append(b)
|
display_group.append(b)
|
||||||
|
|
||||||
board.DISPLAY.show(display_group)
|
board.DISPLAY.root_group = display_group
|
||||||
|
|
||||||
try:
|
try:
|
||||||
board.DISPLAY.refresh(target_frames_per_second=60)
|
board.DISPLAY.refresh(target_frames_per_second=60)
|
||||||
|
|
@ -657,7 +657,7 @@ def default_view():
|
||||||
global label_reflow, oven, message, timediff, plot, sgraph, timer_data
|
global label_reflow, oven, message, timediff, plot, sgraph, timer_data
|
||||||
|
|
||||||
display_group = displayio.Group()
|
display_group = displayio.Group()
|
||||||
board.DISPLAY.show(display_group)
|
board.DISPLAY.root_group = display_group
|
||||||
|
|
||||||
plot = displayio.Bitmap(GWIDTH, GHEIGHT, 4)
|
plot = displayio.Bitmap(GWIDTH, GHEIGHT, 4)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ displaygroup.append(lesssprite)
|
||||||
lesssprite.x = -10
|
lesssprite.x = -10
|
||||||
lesssprite.y = int((HEIGHT - ICONSIZE) / 2)
|
lesssprite.y = int((HEIGHT - ICONSIZE) / 2)
|
||||||
|
|
||||||
display.show(displaygroup)
|
display.root_group = displaygroup
|
||||||
|
|
||||||
filecount = 0
|
filecount = 0
|
||||||
xpos = LEFTSPACE
|
xpos = LEFTSPACE
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class Google_GFX(displayio.Group):
|
||||||
# root displayio group
|
# root displayio group
|
||||||
root_group = displayio.Group()
|
root_group = displayio.Group()
|
||||||
self.display = board.DISPLAY
|
self.display = board.DISPLAY
|
||||||
self.display.show(root_group)
|
self.display.root_group = root_group
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
# temperature display option
|
# temperature display option
|
||||||
|
|
@ -33,7 +33,7 @@ class Google_GFX(displayio.Group):
|
||||||
|
|
||||||
# create background icon group
|
# create background icon group
|
||||||
self._icon_group = displayio.Group()
|
self._icon_group = displayio.Group()
|
||||||
self.display.show(self._icon_group)
|
self.display.root_group = self._icon_group
|
||||||
# create text object group
|
# create text object group
|
||||||
self._text_group = displayio.Group()
|
self._text_group = displayio.Group()
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ class Google_GFX(displayio.Group):
|
||||||
status_group.append(self.gcp_status_label)
|
status_group.append(self.gcp_status_label)
|
||||||
self._text_group.append(status_group)
|
self._text_group.append(status_group)
|
||||||
|
|
||||||
self.display.show(self._text_group)
|
self.display.root_group = self._text_group
|
||||||
|
|
||||||
def show_gcp_status(self, status_text):
|
def show_gcp_status(self, status_text):
|
||||||
"""Displays the system status on the PyPortal
|
"""Displays the system status on the PyPortal
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ text_label.y = 200
|
||||||
text_label.color = 0xFFFFFF
|
text_label.color = 0xFFFFFF
|
||||||
root_group.append(text_label)
|
root_group.append(text_label)
|
||||||
|
|
||||||
board.DISPLAY.show(root_group)
|
board.DISPLAY.root_group = root_group
|
||||||
|
|
||||||
# PyPortal ESP32 Setup
|
# PyPortal ESP32 Setup
|
||||||
esp32_cs = digitalio.DigitalInOut(board.ESP_CS)
|
esp32_cs = digitalio.DigitalInOut(board.ESP_CS)
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ light_brightness = 1.0
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
button_group = displayio.Group()
|
button_group = displayio.Group()
|
||||||
board.DISPLAY.show(button_group)
|
board.DISPLAY.root_group = button_group
|
||||||
# preload the font
|
# preload the font
|
||||||
print('loading font...')
|
print('loading font...')
|
||||||
font = bitmap_font.load_font("/fonts/Arial-12.bdf")
|
font = bitmap_font.load_font("/fonts/Arial-12.bdf")
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ font.load_glyphs(b"abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
splash = displayio.Group()
|
splash = displayio.Group()
|
||||||
board.DISPLAY.show(splash)
|
board.DISPLAY.root_group = splash
|
||||||
|
|
||||||
# Make a background color fill
|
# Make a background color fill
|
||||||
color_bitmap = displayio.Bitmap(320, 240, 1)
|
color_bitmap = displayio.Bitmap(320, 240, 1)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
button_group = displayio.Group()
|
button_group = displayio.Group()
|
||||||
board.DISPLAY.show(button_group)
|
board.DISPLAY.root_group = button_group
|
||||||
# preload the font
|
# preload the font
|
||||||
print('loading font...')
|
print('loading font...')
|
||||||
font = bitmap_font.load_font("/fonts/Arial-12.bdf")
|
font = bitmap_font.load_font("/fonts/Arial-12.bdf")
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ pages_vals = [page_1_vals, page_2_vals, page_3_vals]
|
||||||
page = page_1
|
page = page_1
|
||||||
page_vals = page_1_vals
|
page_vals = page_1_vals
|
||||||
|
|
||||||
board.DISPLAY.show(my_display_group)
|
board.DISPLAY.root_group = my_display_group
|
||||||
print("READY")
|
print("READY")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class Thermometer_GFX(displayio.Group):
|
||||||
"""
|
"""
|
||||||
# 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
|
||||||
|
|
@ -33,7 +33,7 @@ class Thermometer_GFX(displayio.Group):
|
||||||
|
|
||||||
# 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()
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ class Thermometer_GFX(displayio.Group):
|
||||||
self.io_status_text.y = 220
|
self.io_status_text.y = 220
|
||||||
self._text_group.append(self.io_status_text)
|
self._text_group.append(self.io_status_text)
|
||||||
|
|
||||||
board.DISPLAY.show(self._text_group)
|
board.DISPLAY.root_group = self._text_group
|
||||||
|
|
||||||
|
|
||||||
def display_date_time(self, io_time):
|
def display_date_time(self, io_time):
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ pyportal = PyPortal(esp=esp,
|
||||||
|
|
||||||
# Root DisplayIO
|
# Root DisplayIO
|
||||||
root_group = displayio.Group()
|
root_group = displayio.Group()
|
||||||
display.show(root_group)
|
display.root_group = root_group
|
||||||
|
|
||||||
BACKGROUND = BACKGROUND if isinstance(BACKGROUND, int) else 0x0
|
BACKGROUND = BACKGROUND if isinstance(BACKGROUND, int) else 0x0
|
||||||
bg_bitmap = displayio.Bitmap(display.width, display.height, 1)
|
bg_bitmap = displayio.Bitmap(display.width, display.height, 1)
|
||||||
|
|
@ -195,7 +195,7 @@ key_group.append(label_title)
|
||||||
splash.append(key_group)
|
splash.append(key_group)
|
||||||
|
|
||||||
# Show the group
|
# Show the group
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
print("Connecting to AP...")
|
print("Connecting to AP...")
|
||||||
while not esp.is_connected:
|
while not esp.is_connected:
|
||||||
|
|
|
||||||
|
|
@ -422,7 +422,7 @@ text_box(
|
||||||
28,
|
28,
|
||||||
)
|
)
|
||||||
|
|
||||||
board.DISPLAY.show(splash)
|
board.DISPLAY.root_group = splash
|
||||||
|
|
||||||
|
|
||||||
# ------------- Code Loop ------------- #
|
# ------------- Code Loop ------------- #
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ winamp_application = WinampApplication(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add the Group to the Display
|
# Add the Group to the Display
|
||||||
display.show(winamp_application)
|
display.root_group = winamp_application
|
||||||
|
|
||||||
# previous iteration touch events
|
# previous iteration touch events
|
||||||
_previous_touch = None
|
_previous_touch = None
|
||||||
|
|
|
||||||
|
|
@ -47,26 +47,13 @@ g = displayio.Group()
|
||||||
g.append(R)
|
g.append(R)
|
||||||
g.append(B)
|
g.append(B)
|
||||||
g.append(G)
|
g.append(G)
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
display.auto_refresh = True
|
display.auto_refresh = True
|
||||||
|
|
||||||
|
# Setup the filename as the bitmap data source
|
||||||
# CircuitPython 6 & 7 compatible
|
bitmap = displayio.OnDiskBitmap("/rbg.bmp")
|
||||||
bitmap_file = open("/rbg.bmp", "rb")
|
|
||||||
# Setup the file as the bitmap data source
|
|
||||||
bitmap = displayio.OnDiskBitmap(bitmap_file)
|
|
||||||
# Create a TileGrid to hold the bitmap
|
# Create a TileGrid to hold the bitmap
|
||||||
tile_grid = displayio.TileGrid(
|
tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)
|
||||||
bitmap,
|
|
||||||
pixel_shader=getattr(bitmap, 'pixel_shader', displayio.ColorConverter())
|
|
||||||
)
|
|
||||||
|
|
||||||
# # CircuitPython 7+ compatible
|
|
||||||
# # Setup the filename as the bitmap data source
|
|
||||||
# bitmap = displayio.OnDiskBitmap("/rbg.bmp")
|
|
||||||
# # Create a TileGrid to hold the bitmap
|
|
||||||
# tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)
|
|
||||||
|
|
||||||
|
|
||||||
print(dir(tile_grid))
|
print(dir(tile_grid))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ dreidel_grid = displayio.TileGrid(dreidel_bit, pixel_shader=dreidel_pal,
|
||||||
group.append(dreidel_grid)
|
group.append(dreidel_grid)
|
||||||
|
|
||||||
# show dreidel bitmap
|
# show dreidel bitmap
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
timer = 0 # time.monotonic() holder
|
timer = 0 # time.monotonic() holder
|
||||||
spin = 0 # index for tilegrid
|
spin = 0 # index for tilegrid
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ for idx in range(3):
|
||||||
wheel.y = -20
|
wheel.y = -20
|
||||||
g.append(wheel)
|
g.append(wheel)
|
||||||
wheels.append(wheel)
|
wheels.append(wheel)
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
# We want a digital input to trigger the fruit machine
|
# We want a digital input to trigger the fruit machine
|
||||||
button = digitalio.DigitalInOut(board.A1)
|
button = digitalio.DigitalInOut(board.A1)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue