another batch
This commit is contained in:
parent
6cbf7ecce4
commit
e6296b12a7
29 changed files with 38 additions and 38 deletions
|
|
@ -82,7 +82,7 @@ def blankScreen(disp, pix):
|
||||||
if disp is None:
|
if disp is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
disp.show(Group())
|
disp.root_group = Group()
|
||||||
|
|
||||||
|
|
||||||
class RPSDisplay():
|
class RPSDisplay():
|
||||||
|
|
@ -200,7 +200,7 @@ class RPSDisplay():
|
||||||
|
|
||||||
def showGroup(self, new_group):
|
def showGroup(self, new_group):
|
||||||
self.disp_group = new_group
|
self.disp_group = new_group
|
||||||
self.disp.show(new_group)
|
self.disp.root_group = new_group
|
||||||
|
|
||||||
|
|
||||||
def emptyGroup(self, dio_group):
|
def emptyGroup(self, dio_group):
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ setCursor(my_choice_idx, "your")
|
||||||
opp_cursor_dob.y = top_y_pos
|
opp_cursor_dob.y = top_y_pos
|
||||||
screen_group.append(opp_cursor_dob)
|
screen_group.append(opp_cursor_dob)
|
||||||
|
|
||||||
display.show(screen_group)
|
display.root_group = screen_group
|
||||||
|
|
||||||
# From adafruit_ble.advertising
|
# From adafruit_ble.advertising
|
||||||
MANUFACTURING_DATA_ADT = 0xFF
|
MANUFACTURING_DATA_ADT = 0xFF
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ group.append(press_label)
|
||||||
group.append(temp_data)
|
group.append(temp_data)
|
||||||
group.append(press_data)
|
group.append(press_data)
|
||||||
|
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
# function to convert celcius to fahrenheit
|
# function to convert celcius to fahrenheit
|
||||||
def c_to_f(temp):
|
def c_to_f(temp):
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ def set_status(label, action_text, player):
|
||||||
|
|
||||||
display = tft_gizmo.TFT_Gizmo()
|
display = tft_gizmo.TFT_Gizmo()
|
||||||
group = displayio.Group()
|
group = displayio.Group()
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if not radio.connected:
|
if not radio.connected:
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ def wrap_in_tilegrid(filename:str):
|
||||||
display = tft_gizmo.TFT_Gizmo()
|
display = tft_gizmo.TFT_Gizmo()
|
||||||
group = displayio.Group()
|
group = displayio.Group()
|
||||||
group.append(wrap_in_tilegrid("/ancs_connect.bmp"))
|
group.append(wrap_in_tilegrid("/ancs_connect.bmp"))
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
current_notification = None
|
current_notification = None
|
||||||
current_notifications = {}
|
current_notifications = {}
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ def sensor_values():
|
||||||
clean_up(group)
|
clean_up(group)
|
||||||
group.scale = 1
|
group.scale = 1
|
||||||
|
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
show_shapes()
|
show_shapes()
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
reg_label = label.Label(
|
reg_label = label.Label(
|
||||||
font=terminalio.FONT,
|
font=terminalio.FONT,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
font = bitmap_font.load_font("fonts/Fayette-HandwrittenScript-48.bdf")
|
font = bitmap_font.load_font("fonts/Fayette-HandwrittenScript-48.bdf")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
|
|
||||||
# Font definition. You can choose any two fonts available in your system
|
# Font definition. You can choose any two fonts available in your system
|
||||||
|
|
@ -70,7 +70,7 @@ right_text_aligned = label.Label(
|
||||||
)
|
)
|
||||||
|
|
||||||
main_group.append(right_text_aligned)
|
main_group.append(right_text_aligned)
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
reg_label = label.Label(
|
reg_label = label.Label(
|
||||||
font=terminalio.FONT,
|
font=terminalio.FONT,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
DISPLAY_WIDTH = 320
|
DISPLAY_WIDTH = 320
|
||||||
DISPLAY_HEIGHT = 240
|
DISPLAY_HEIGHT = 240
|
||||||
TEXT = "Hello"
|
TEXT = "Hello"
|
||||||
|
|
@ -75,7 +75,7 @@ text_group.append(text_area_bottom_middle)
|
||||||
text_group.append(text_area_bottom_left)
|
text_group.append(text_area_bottom_left)
|
||||||
text_group.append(text_area_bottom_right)
|
text_group.append(text_area_bottom_right)
|
||||||
|
|
||||||
display.show(text_group)
|
display.root_group = text_group
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")
|
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")
|
||||||
# font = terminalio.FONT
|
# font = terminalio.FONT
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# font = bitmap_font.load_font("Fayette-HandwrittenScript-48.bdf")
|
# font = bitmap_font.load_font("Fayette-HandwrittenScript-48.bdf")
|
||||||
font = terminalio.FONT
|
font = terminalio.FONT
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# font = bitmap_font.load_font("Fayette-HandwrittenScript-48.bdf")
|
# font = bitmap_font.load_font("Fayette-HandwrittenScript-48.bdf")
|
||||||
font = terminalio.FONT
|
font = terminalio.FONT
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ display = board.DISPLAY
|
||||||
|
|
||||||
# Make the display context
|
# Make the display context
|
||||||
main_group = displayio.Group()
|
main_group = displayio.Group()
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# create the label
|
# create the label
|
||||||
updating_label = label.Label(
|
updating_label = label.Label(
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ next_filename("gif")
|
||||||
|
|
||||||
# Blank the whole display
|
# Blank the whole display
|
||||||
g = displayio.Group()
|
g = displayio.Group()
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
display.auto_refresh = False
|
display.auto_refresh = False
|
||||||
display.refresh()
|
display.refresh()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ def make_tilegrid():
|
||||||
x=0, y=-64,
|
x=0, y=-64,
|
||||||
default_tile=EMPTY)
|
default_tile=EMPTY)
|
||||||
group.append(grid)
|
group.append(grid)
|
||||||
display.show(group)
|
display.root_group = group
|
||||||
return grid
|
return grid
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ buttons = keypad.ShiftRegisterKeys(
|
||||||
)
|
)
|
||||||
|
|
||||||
# show the main group on the display
|
# show the main group on the display
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
# main loop
|
# main loop
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ from micropython import const
|
||||||
|
|
||||||
def clear_display():
|
def clear_display():
|
||||||
"""Display nothing"""
|
"""Display nothing"""
|
||||||
board.DISPLAY.show(displayio.Group())
|
board.DISPLAY.root_group = displayio.Group()
|
||||||
|
|
||||||
clear_display()
|
clear_display()
|
||||||
|
|
||||||
|
|
@ -293,7 +293,7 @@ speaker.play(mp3stream)
|
||||||
|
|
||||||
font = adafruit_bitmap_font.bitmap_font.load_font("rsrc/5x8.pcf")
|
font = adafruit_bitmap_font.bitmap_font.load_font("rsrc/5x8.pcf")
|
||||||
playback_display = PlaybackDisplay()
|
playback_display = PlaybackDisplay()
|
||||||
board.DISPLAY.show(playback_display.group)
|
board.DISPLAY.root_group = playback_display.group
|
||||||
font.load_glyphs(range(32, 128))
|
font.load_glyphs(range(32, 128))
|
||||||
|
|
||||||
joystick = analogjoy.AnalogJoystick()
|
joystick = analogjoy.AnalogJoystick()
|
||||||
|
|
@ -358,7 +358,7 @@ def menu_choice(seq, *, sel_idx=0, text_font=font):
|
||||||
|
|
||||||
last_scroll_idx = max(0, len(seq) - num_rows)
|
last_scroll_idx = max(0, len(seq) - num_rows)
|
||||||
|
|
||||||
board.DISPLAY.show(scene)
|
board.DISPLAY.root_group = scene
|
||||||
buttons.events.clear()
|
buttons.events.clear()
|
||||||
i = 0
|
i = 0
|
||||||
old_scroll_idx = None
|
old_scroll_idx = None
|
||||||
|
|
@ -472,7 +472,7 @@ def play_all(playlist, *, folder='', trim=0, location='/sd'):
|
||||||
|
|
||||||
'folder' is a display name for the user."""
|
'folder' is a display name for the user."""
|
||||||
i = 0
|
i = 0
|
||||||
board.DISPLAY.show(playback_display.group)
|
board.DISPLAY.root_group = playback_display.group
|
||||||
playback_display.iconbar.group.y = 112
|
playback_display.iconbar.group.y = 112
|
||||||
while 0 <= i < len(playlist):
|
while 0 <= i < len(playlist):
|
||||||
filename = playlist[i]
|
filename = playlist[i]
|
||||||
|
|
@ -520,7 +520,7 @@ def main():
|
||||||
error_text.y = board.DISPLAY.height // 2
|
error_text.y = board.DISPLAY.height // 2
|
||||||
g = displayio.Group()
|
g = displayio.Group()
|
||||||
g.append(error_text)
|
g.append(error_text)
|
||||||
board.DISPLAY.show(g)
|
board.DISPLAY.root_group = g
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ display.auto_refresh = False
|
||||||
font = bitmap_font.load_font("/digit-16px.pcf")
|
font = bitmap_font.load_font("/digit-16px.pcf")
|
||||||
text_area = label.Label(font, text=" ", line_spacing=0.95)
|
text_area = label.Label(font, text=" ", line_spacing=0.95)
|
||||||
text_area.y = 8
|
text_area.y = 8
|
||||||
display.show(text_area)
|
display.root_group = text_area
|
||||||
|
|
||||||
N = float
|
N = float
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ display = adafruit_ili9341.ILI9341(display_bus, width=DISPLAY_WIDTH, height=DISP
|
||||||
|
|
||||||
# add base UI element
|
# add base UI element
|
||||||
splash = displayio.Group(scale=SKETCH_SCALE)
|
splash = displayio.Group(scale=SKETCH_SCALE)
|
||||||
display.show(splash)
|
display.root_group = splash
|
||||||
|
|
||||||
# add sketch
|
# add sketch
|
||||||
sketch_bitmap = displayio.Bitmap(SKETCH_WIDTH, SKETCH_HEIGHT, 2)
|
sketch_bitmap = displayio.Bitmap(SKETCH_WIDTH, SKETCH_HEIGHT, 2)
|
||||||
|
|
|
||||||
|
|
@ -580,7 +580,7 @@ neko.y = display.height // 2 - neko.TILE_HEIGHT // 2
|
||||||
main_group.append(neko)
|
main_group.append(neko)
|
||||||
|
|
||||||
# show main_group on the display
|
# show main_group on the display
|
||||||
display.show(main_group)
|
display.root_group = main_group
|
||||||
|
|
||||||
if USE_TOUCH_OVERLAY:
|
if USE_TOUCH_OVERLAY:
|
||||||
# initialize laser palette
|
# initialize laser palette
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,4 @@ while True:
|
||||||
watch_group.append(date)
|
watch_group.append(date)
|
||||||
watch_group.append(text)
|
watch_group.append(text)
|
||||||
|
|
||||||
oled.show(watch_group)
|
oled.root_group = watch_group
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,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
|
||||||
|
|
||||||
# Make a unique order of the emoji on each wheel
|
# Make a unique order of the emoji on each wheel
|
||||||
orders = [shuffled(range(20)), shuffled(range(20)), shuffled(range(20))]
|
orders = [shuffled(range(20)), shuffled(range(20)), shuffled(range(20))]
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ tg1 = displayio.TileGrid(b1, pixel_shader=palette)
|
||||||
tg2 = displayio.TileGrid(b2, pixel_shader=palette)
|
tg2 = displayio.TileGrid(b2, pixel_shader=palette)
|
||||||
g1 = displayio.Group(scale=SCALE)
|
g1 = displayio.Group(scale=SCALE)
|
||||||
g1.append(tg1)
|
g1.append(tg1)
|
||||||
display.show(g1)
|
display.root_group = g1
|
||||||
g2 = displayio.Group(scale=SCALE)
|
g2 = displayio.Group(scale=SCALE)
|
||||||
g2.append(tg2)
|
g2.append(tg2)
|
||||||
|
|
||||||
|
|
@ -108,9 +108,9 @@ while True:
|
||||||
# values, 400 frames seems like a good number. Working in this way, with
|
# values, 400 frames seems like a good number. Working in this way, with
|
||||||
# two bitmaps, reduces copying data and makes the animation a bit faster
|
# two bitmaps, reduces copying data and makes the animation a bit faster
|
||||||
for _ in range(n):
|
for _ in range(n):
|
||||||
display.show(g1)
|
display.root_group = g1
|
||||||
apply_life_rule(b1, b2)
|
apply_life_rule(b1, b2)
|
||||||
display.show(g2)
|
display.root_group = g2
|
||||||
apply_life_rule(b2, b1)
|
apply_life_rule(b2, b1)
|
||||||
|
|
||||||
# After 2*n generations, fill the board with random values and
|
# After 2*n generations, fill the board with random values and
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ g.append(t)
|
||||||
l = Label(text="Feather\nRP2040", font=terminalio.FONT, color=0xffffff, line_spacing=.7)
|
l = Label(text="Feather\nRP2040", font=terminalio.FONT, color=0xffffff, line_spacing=.7)
|
||||||
g.append(l)
|
g.append(l)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
target_fps = 50
|
target_fps = 50
|
||||||
ft = 1/target_fps
|
ft = 1/target_fps
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ l1 = displayio.Group()
|
||||||
l2 = displayio.Group()
|
l2 = displayio.Group()
|
||||||
g.append(l1)
|
g.append(l1)
|
||||||
g.append(l2)
|
g.append(l2)
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
l1.y = 1
|
l1.y = 1
|
||||||
l2.y = 16
|
l2.y = 16
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ line2.y = 24
|
||||||
g = displayio.Group()
|
g = displayio.Group()
|
||||||
g.append(line1)
|
g.append(line1)
|
||||||
g.append(line2)
|
g.append(line2)
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
# This function will scoot one label a pixel to the left and send it back to
|
# This function will scoot one label a pixel to the left and send it back to
|
||||||
# the far right if it's gone all the way off screen. This goes in a function
|
# the far right if it's gone all the way off screen. This goes in a function
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ TILEGRID = displayio.TileGrid(
|
||||||
|
|
||||||
GROUP = displayio.Group()
|
GROUP = displayio.Group()
|
||||||
GROUP.append(TILEGRID)
|
GROUP.append(TILEGRID)
|
||||||
DISPLAY.show(GROUP)
|
DISPLAY.root_group = GROUP
|
||||||
DISPLAY.refresh()
|
DISPLAY.refresh()
|
||||||
|
|
||||||
# Nothing interactive, just hold the image there
|
# Nothing interactive, just hold the image there
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue