diff --git a/PicoW_CircuitPython_HTTP_Server/code.py b/PicoW_CircuitPython_HTTP_Server/code.py index 9ed574699..d56ca7205 100644 --- a/PicoW_CircuitPython_HTTP_Server/code.py +++ b/PicoW_CircuitPython_HTTP_Server/code.py @@ -57,7 +57,7 @@ display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HE # default display group splash = displayio.Group() -display.show(splash) +display.root_group = splash # connect to network print() @@ -235,7 +235,7 @@ while True: #if parrot is True: if parrot_pin.value is True: # switch to party parrot display group - display.show(parrot_group) + display.root_group = parrot_group if (party + 0.1) < time.monotonic(): # the party parrot animation cycles parrot_grid[0] = p @@ -245,7 +245,7 @@ while True: # if it isn't a party else: # show default display with info - display.show(splash) + display.root_group = splash # poll the server for incoming/outgoing requests server.poll() # pylint: disable=broad-except diff --git a/Pico_MIDI_Fighter/code.py b/Pico_MIDI_Fighter/code.py index 124c57597..51ecff4f3 100644 --- a/Pico_MIDI_Fighter/code.py +++ b/Pico_MIDI_Fighter/code.py @@ -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] # show main display GUI -display.show(splash) +display.root_group = splash while True: @@ -314,7 +314,7 @@ while True: # if an arcade button is selected to change the MIDI note... if sub_state: # display the secondary GUI menu - display.show(big_splash) + display.root_group = big_splash # display the selected button's MIDI note big_text.text = str(midi_num) @@ -368,6 +368,6 @@ while True: # update new MIDI number text label text_labels[button_pos].text = str(midi_num) # show main GUI display - display.show(splash) + display.root_group = splash # turn off blinking LED leds[button_pos].value = False diff --git a/PipBoy_2040/code.py b/PipBoy_2040/code.py index c28f03235..997875c08 100644 --- a/PipBoy_2040/code.py +++ b/PipBoy_2040/code.py @@ -24,7 +24,7 @@ display_bus = displayio.FourWire( display = ST7789(display_bus, width=280, height=240, rowstart=20, rotation=270) 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 image = displayio.OnDiskBitmap("/img/bootpip0.bmp") @@ -43,7 +43,7 @@ if cursor_on: cursor.x = 0 # hide cursor during bootup cursor.y = 0 -display.show(screen) +display.root_group = screen boot_file_names = [ "/img/bootpip0.bmp", diff --git a/PyBadge_Blinka_Jump_Game/code.py b/PyBadge_Blinka_Jump_Game/code.py index 22f4d6d4b..88fb29f1e 100644 --- a/PyBadge_Blinka_Jump_Game/code.py +++ b/PyBadge_Blinka_Jump_Game/code.py @@ -162,7 +162,7 @@ text_group.append(new_game_text) group.append(text_group) # displaying main display group -display.show(group) +display.root_group = group # state for hit detection crash = False diff --git a/PyBadge_Conference_Badge/code.py b/PyBadge_Conference_Badge/code.py index 358c08047..42f96c674 100755 --- a/PyBadge_Conference_Badge/code.py +++ b/PyBadge_Conference_Badge/code.py @@ -65,7 +65,7 @@ pad = ShiftRegisterKeys( # Make the Display Background splash = displayio.Group() -board.DISPLAY.show(splash) +board.DISPLAY.root_group = splash color_bitmap = displayio.Bitmap(160, 128, 1) color_palette = displayio.Palette(1) diff --git a/PyGamer_Improved_Thermal_Camera/code.py b/PyGamer_Improved_Thermal_Camera/code.py index d14feb1d8..166464118 100755 --- a/PyGamer_Improved_Thermal_Camera/code.py +++ b/PyGamer_Improved_Thermal_Camera/code.py @@ -81,7 +81,7 @@ amg8833 = adafruit_amg88xx.AMG88XX(i2c) splash = displayio.Group(scale=display.width // 160) bitmap = displayio.OnDiskBitmap("/thermalcamera_splash.bmp") 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 SENSOR_AXIS = 8 @@ -381,7 +381,7 @@ orig_max_range_f = 0 # Establish temporary range variables orig_min_range_f = 0 # Activate display, show preloaded sample spectrum, and play welcome tone -display.show(image_group) +display.root_group = image_group update_image_frame() flash_status("IRON", 0.75) play_tone(880, 0.010) # Musical note A5 diff --git a/PyGamer_NeoPixel_Strip_Control/code.py b/PyGamer_NeoPixel_Strip_Control/code.py index 979711f4d..bb5e4126b 100755 --- a/PyGamer_NeoPixel_Strip_Control/code.py +++ b/PyGamer_NeoPixel_Strip_Control/code.py @@ -82,7 +82,7 @@ mouse_cursor = Cursor(display, display_group=splash) cursor = DebouncedCursorManager(mouse_cursor) # Show splash group -display.show(splash) +display.root_group = splash prev_btn = None while True: diff --git a/PyGamer_Thermal_Camera/code.py b/PyGamer_Thermal_Camera/code.py index fd93f20f0..99a340801 100644 --- a/PyGamer_Thermal_Camera/code.py +++ b/PyGamer_Thermal_Camera/code.py @@ -35,21 +35,12 @@ amg8833 = adafruit_amg88xx.AMG88XX(i2c) font = bitmap_font.load_font("/fonts/OpenSans-9.bdf") # 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() -# bitmap = displayio.OnDiskBitmap("/thermal_cam_splash.bmp") -# splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)) -# board.DISPLAY.show(splash) -# time.sleep(0.1) # Allow the splash to display +splash = displayio.Group() +bitmap = displayio.OnDiskBitmap("/thermal_cam_splash.bmp") +splash.append(displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader)) +board.DISPLAY.root_group = splash +time.sleep(0.1) # Allow the splash to display panel.play_tone(440, 0.1) # A4 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 # 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 ###--- PRIMARY PROCESS LOOP ---### diff --git a/PyLeap_CLUE_BLE_NeoPixels/code.py b/PyLeap_CLUE_BLE_NeoPixels/code.py index a6fcd2860..18be65f09 100644 --- a/PyLeap_CLUE_BLE_NeoPixels/code.py +++ b/PyLeap_CLUE_BLE_NeoPixels/code.py @@ -67,7 +67,7 @@ text_area.anchored_position = (240 / 2, 240 / 2) text_area.scale = 2 clue_group.append(text_area) -display.show(clue_group) +display.root_group = clue_group class RainbowFade(Animation): ''' fades the entire strip through the whole spectrum ''' diff --git a/PyPortal_AWS_IOT_Planter/aws_gfx_helper.py b/PyPortal_AWS_IOT_Planter/aws_gfx_helper.py index 8f101a114..ac94561af 100755 --- a/PyPortal_AWS_IOT_Planter/aws_gfx_helper.py +++ b/PyPortal_AWS_IOT_Planter/aws_gfx_helper.py @@ -25,7 +25,7 @@ class AWS_GFX(displayio.Group): # root displayio group root_group = displayio.Group() self.display = board.DISPLAY - self.display.show(root_group) + self.display.root_group = root_group super().__init__() # temperature display option @@ -33,7 +33,7 @@ class AWS_GFX(displayio.Group): # create background icon group self._icon_group = displayio.Group() - self.display.show(self._icon_group) + self.display.root_group = self._icon_group # create text object group self._text_group = displayio.Group() @@ -85,7 +85,7 @@ class AWS_GFX(displayio.Group): status_group.append(self.aws_status_label) 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): """Displays the system status on the PyPortal diff --git a/PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py b/PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py index 1c0f70337..1ca97732a 100755 --- a/PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py +++ b/PyPortal_Azure_Plant_Monitor/azure_gfx_helper.py @@ -25,7 +25,7 @@ class Azure_GFX(displayio.Group): """ # root displayio group root_group = displayio.Group() - board.DISPLAY.show(root_group) + board.DISPLAY.root_group = root_group super().__init__() # temperature display option @@ -33,7 +33,7 @@ class Azure_GFX(displayio.Group): # create background icon group self._icon_group = displayio.Group() - board.DISPLAY.show(self._icon_group) + board.DISPLAY.root_group = self._icon_group # create text object group self._text_group = displayio.Group() @@ -83,7 +83,7 @@ class Azure_GFX(displayio.Group): self._text_group.append(self.azure_status_text) def show_text(self): - board.DISPLAY.show(self._text_group) + board.DISPLAY.root_group = self._text_group def display_azure_status(self, status_text): """Displays the system status on the PyPortal diff --git a/PyPortal_BusySimulator/code.py b/PyPortal_BusySimulator/code.py index a6926ffec..25501cbdf 100644 --- a/PyPortal_BusySimulator/code.py +++ b/PyPortal_BusySimulator/code.py @@ -67,7 +67,7 @@ _icons = [ # Make the display context. display = board.DISPLAY main_group = displayio.Group() -display.show(main_group) +display.root_group = main_group # Touchscreen initialization ts = adafruit_touchscreen.Touchscreen( diff --git a/PyPortal_Calculator/code.py b/PyPortal_Calculator/code.py index 1e1877b03..68324b919 100755 --- a/PyPortal_Calculator/code.py +++ b/PyPortal_Calculator/code.py @@ -35,7 +35,7 @@ LABEL_OFFSET = 290 # Make the display context calc_group = displayio.Group() -board.DISPLAY.show(calc_group) +board.DISPLAY.root_group = calc_group # Make a background color fill color_bitmap = displayio.Bitmap(320, 240, 1) diff --git a/PyPortal_Calculator/titano_code.py b/PyPortal_Calculator/titano_code.py index 9ae0c59fa..a1d17cde7 100644 --- a/PyPortal_Calculator/titano_code.py +++ b/PyPortal_Calculator/titano_code.py @@ -38,7 +38,7 @@ ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR, # Make the display context calc_group = displayio.Group() -board.DISPLAY.show(calc_group) +board.DISPLAY.root_group = calc_group # Make a background color fill color_bitmap = displayio.Bitmap(SCREEN_WIDTH, SCREEN_HEIGHT, 1) diff --git a/PyPortal_EZ_Make_Oven/code.py b/PyPortal_EZ_Make_Oven/code.py index 79e122426..e370ea3db 100644 --- a/PyPortal_EZ_Make_Oven/code.py +++ b/PyPortal_EZ_Make_Oven/code.py @@ -610,7 +610,7 @@ def change_profile(oven): for b in buttons: display_group.append(b) - board.DISPLAY.show(display_group) + board.DISPLAY.root_group = display_group try: 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 display_group = displayio.Group() - board.DISPLAY.show(display_group) + board.DISPLAY.root_group = display_group plot = displayio.Bitmap(GWIDTH, GHEIGHT, 4) diff --git a/PyPortal_Floppy_with_Display/code.py b/PyPortal_Floppy_with_Display/code.py index ea4ea00a7..e8adbed90 100644 --- a/PyPortal_Floppy_with_Display/code.py +++ b/PyPortal_Floppy_with_Display/code.py @@ -105,7 +105,7 @@ displaygroup.append(lesssprite) lesssprite.x = -10 lesssprite.y = int((HEIGHT - ICONSIZE) / 2) -display.show(displaygroup) +display.root_group = displaygroup filecount = 0 xpos = LEFTSPACE diff --git a/PyPortal_GCP_IOT_Planter/gcp_gfx_helper.py b/PyPortal_GCP_IOT_Planter/gcp_gfx_helper.py index 0c9e962c8..fe6aa0720 100644 --- a/PyPortal_GCP_IOT_Planter/gcp_gfx_helper.py +++ b/PyPortal_GCP_IOT_Planter/gcp_gfx_helper.py @@ -25,7 +25,7 @@ class Google_GFX(displayio.Group): # root displayio group root_group = displayio.Group() self.display = board.DISPLAY - self.display.show(root_group) + self.display.root_group = root_group super().__init__() # temperature display option @@ -33,7 +33,7 @@ class Google_GFX(displayio.Group): # create background icon group self._icon_group = displayio.Group() - self.display.show(self._icon_group) + self.display.root_group = self._icon_group # create text object group self._text_group = displayio.Group() @@ -85,7 +85,7 @@ class Google_GFX(displayio.Group): status_group.append(self.gcp_status_label) 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): """Displays the system status on the PyPortal diff --git a/PyPortal_IOT_Scale/code.py b/PyPortal_IOT_Scale/code.py index 800262910..a10cd0c59 100644 --- a/PyPortal_IOT_Scale/code.py +++ b/PyPortal_IOT_Scale/code.py @@ -61,7 +61,7 @@ text_label.y = 200 text_label.color = 0xFFFFFF root_group.append(text_label) -board.DISPLAY.show(root_group) +board.DISPLAY.root_group = root_group # PyPortal ESP32 Setup esp32_cs = digitalio.DigitalInOut(board.ESP_CS) diff --git a/PyPortal_LIFX_Controller/code.py b/PyPortal_LIFX_Controller/code.py index 2614aff63..4fa95bd93 100755 --- a/PyPortal_LIFX_Controller/code.py +++ b/PyPortal_LIFX_Controller/code.py @@ -62,7 +62,7 @@ light_brightness = 1.0 # Make the display context button_group = displayio.Group() -board.DISPLAY.show(button_group) +board.DISPLAY.root_group = button_group # preload the font print('loading font...') font = bitmap_font.load_font("/fonts/Arial-12.bdf") diff --git a/PyPortal_MQTT_Control/code.py b/PyPortal_MQTT_Control/code.py index 3890b01b7..9d38d5f40 100644 --- a/PyPortal_MQTT_Control/code.py +++ b/PyPortal_MQTT_Control/code.py @@ -90,7 +90,7 @@ font.load_glyphs(b"abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789 # Make the display context splash = displayio.Group() -board.DISPLAY.show(splash) +board.DISPLAY.root_group = splash # Make a background color fill color_bitmap = displayio.Bitmap(320, 240, 1) diff --git a/PyPortal_Philips_Hue_Controller/code.py b/PyPortal_Philips_Hue_Controller/code.py index eda154651..4713eecef 100644 --- a/PyPortal_Philips_Hue_Controller/code.py +++ b/PyPortal_Philips_Hue_Controller/code.py @@ -64,7 +64,7 @@ ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR, # Make the display context button_group = displayio.Group() -board.DISPLAY.show(button_group) +board.DISPLAY.root_group = button_group # preload the font print('loading font...') font = bitmap_font.load_font("/fonts/Arial-12.bdf") diff --git a/PyPortal_Remote/code.py b/PyPortal_Remote/code.py index fd5cde24c..7a1c24af9 100644 --- a/PyPortal_Remote/code.py +++ b/PyPortal_Remote/code.py @@ -212,7 +212,7 @@ pages_vals = [page_1_vals, page_2_vals, page_3_vals] page = page_1 page_vals = page_1_vals -board.DISPLAY.show(my_display_group) +board.DISPLAY.root_group = my_display_group print("READY") diff --git a/PyPortal_Smart_Thermometer/thermometer_helper.py b/PyPortal_Smart_Thermometer/thermometer_helper.py index 1f1a9d6e6..1786f253e 100644 --- a/PyPortal_Smart_Thermometer/thermometer_helper.py +++ b/PyPortal_Smart_Thermometer/thermometer_helper.py @@ -25,7 +25,7 @@ class Thermometer_GFX(displayio.Group): """ # root displayio group root_group = displayio.Group() - board.DISPLAY.show(root_group) + board.DISPLAY.root_group = root_group super().__init__() self._celsius = celsius @@ -33,7 +33,7 @@ class Thermometer_GFX(displayio.Group): # create background icon group self._icon_group = displayio.Group() - board.DISPLAY.show(self._icon_group) + board.DISPLAY.root_group = self._icon_group # create text object group self._text_group = displayio.Group() @@ -82,7 +82,7 @@ class Thermometer_GFX(displayio.Group): self.io_status_text.y = 220 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): diff --git a/PyPortal_TOTP_Friend/code.py b/PyPortal_TOTP_Friend/code.py index d209f8c75..99cceb019 100644 --- a/PyPortal_TOTP_Friend/code.py +++ b/PyPortal_TOTP_Friend/code.py @@ -165,7 +165,7 @@ pyportal = PyPortal(esp=esp, # Root DisplayIO root_group = displayio.Group() -display.show(root_group) +display.root_group = root_group BACKGROUND = BACKGROUND if isinstance(BACKGROUND, int) else 0x0 bg_bitmap = displayio.Bitmap(display.width, display.height, 1) @@ -195,7 +195,7 @@ key_group.append(label_title) splash.append(key_group) # Show the group -display.show(splash) +display.root_group = splash print("Connecting to AP...") while not esp.is_connected: diff --git a/PyPortal_User_Interface/code.py b/PyPortal_User_Interface/code.py index a4682fde2..4feee76fe 100644 --- a/PyPortal_User_Interface/code.py +++ b/PyPortal_User_Interface/code.py @@ -422,7 +422,7 @@ text_box( 28, ) -board.DISPLAY.show(splash) +board.DISPLAY.root_group = splash # ------------- Code Loop ------------- # diff --git a/PyPortal_Winamp_Player/code.py b/PyPortal_Winamp_Player/code.py index 947ade1c7..aae76c5d7 100644 --- a/PyPortal_Winamp_Player/code.py +++ b/PyPortal_Winamp_Player/code.py @@ -102,7 +102,7 @@ winamp_application = WinampApplication( ) # Add the Group to the Display -display.show(winamp_application) +display.root_group = winamp_application # previous iteration touch events _previous_touch = None diff --git a/RBG_Matrix/code.py b/RBG_Matrix/code.py index df6b13457..f49e47b15 100644 --- a/RBG_Matrix/code.py +++ b/RBG_Matrix/code.py @@ -47,26 +47,13 @@ g = displayio.Group() g.append(R) g.append(B) g.append(G) -display.show(g) +display.root_group = g display.auto_refresh = True - -# CircuitPython 6 & 7 compatible -bitmap_file = open("/rbg.bmp", "rb") -# Setup the file as the bitmap data source -bitmap = displayio.OnDiskBitmap(bitmap_file) +# 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=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) - +tile_grid = displayio.TileGrid(bitmap, pixel_shader=bitmap.pixel_shader) print(dir(tile_grid)) diff --git a/RGB_Matrix_Dreidel_Game/code.py b/RGB_Matrix_Dreidel_Game/code.py index 0853fd403..f5a7ad0c0 100644 --- a/RGB_Matrix_Dreidel_Game/code.py +++ b/RGB_Matrix_Dreidel_Game/code.py @@ -68,7 +68,7 @@ dreidel_grid = displayio.TileGrid(dreidel_bit, pixel_shader=dreidel_pal, group.append(dreidel_grid) # show dreidel bitmap -display.show(group) +display.root_group = group timer = 0 # time.monotonic() holder spin = 0 # index for tilegrid diff --git a/RGB_Matrix_Slot_Machine/code.py b/RGB_Matrix_Slot_Machine/code.py index 747b2f0a7..456297e9c 100644 --- a/RGB_Matrix_Slot_Machine/code.py +++ b/RGB_Matrix_Slot_Machine/code.py @@ -113,7 +113,7 @@ for idx in range(3): wheel.y = -20 g.append(wheel) wheels.append(wheel) -display.show(g) +display.root_group = g # We want a digital input to trigger the fruit machine button = digitalio.DigitalInOut(board.A1)