diff --git a/CLUE_Light_Painter/code.py b/CLUE_Light_Painter/code.py index 2346a0506..74bd2b305 100755 --- a/CLUE_Light_Painter/code.py +++ b/CLUE_Light_Painter/code.py @@ -230,7 +230,7 @@ class ClueLightPainter: board.DISPLAY.root_group = group sleep(4) - board.DISPLAY.show(displayio.Group()) # Clear display + board.DISPLAY.root_group = displayio.Group() # Clear display self.clear_strip() # LEDs off diff --git a/CLUE_Sensor_Plotter/plotter.py b/CLUE_Sensor_Plotter/plotter.py index 9f9dfe242..a24fcfede 100644 --- a/CLUE_Sensor_Plotter/plotter.py +++ b/CLUE_Sensor_Plotter/plotter.py @@ -444,7 +444,7 @@ class Plotter: if self._displayio_graph is None: self._displayio_graph = self._make_empty_graph(tg_and_plot=tg_and_plot) - self._output.show(self._displayio_graph) + self._output.root_group = self._displayio_graph def display_off(self): pass diff --git a/CircuitPython_CLUEbot/robot.py b/CircuitPython_CLUEbot/robot.py index 3fb7c543c..5d9bcf03b 100755 --- a/CircuitPython_CLUEbot/robot.py +++ b/CircuitPython_CLUEbot/robot.py @@ -66,7 +66,7 @@ class Robot: def _init_display(self): self.display = board.DISPLAY self.display_group = displayio.Group() - self.display.show(self.display_group) + self.display.root_group = self.display_group self.shape_color = 0 self.bg_color = 0xFFFF00 rect = vectorio.Rectangle( diff --git a/CircuitPython_Display_Text/colormask_example/code.py b/CircuitPython_Display_Text/colormask_example/code.py index f5f9ca1ab..cc5bc5810 100644 --- a/CircuitPython_Display_Text/colormask_example/code.py +++ b/CircuitPython_Display_Text/colormask_example/code.py @@ -21,7 +21,7 @@ bg_palette[0] = 0xDDDD00 # Make the display context main_group = displayio.Group() -display.show(main_group) +display.root_group = main_group font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf") reg_label = label.Label( diff --git a/CircuitPython_Display_Text/scale_example/code.py b/CircuitPython_Display_Text/scale_example/code.py index 064197aeb..e5f1c41b9 100644 --- a/CircuitPython_Display_Text/scale_example/code.py +++ b/CircuitPython_Display_Text/scale_example/code.py @@ -15,7 +15,7 @@ display = board.DISPLAY # Make the display context main_group = displayio.Group() -display.show(main_group) +display.root_group = main_group font = terminalio.FONT diff --git a/CircuitPython_PyPaint/code.py b/CircuitPython_PyPaint/code.py index a04c3089e..b0bbf3620 100644 --- a/CircuitPython_PyPaint/code.py +++ b/CircuitPython_PyPaint/code.py @@ -211,7 +211,7 @@ class Paint(object): self._palette = self._make_palette() self._splash.append(self._palette) - self._display.show(self._splash) + self._display.root_group = self._splash try: gc.collect() self._display.refresh(target_frames_per_second=60) diff --git a/CircuitPython_Pyloton/pyloton.py b/CircuitPython_Pyloton/pyloton.py index 61ea450ce..a7daf708f 100644 --- a/CircuitPython_Pyloton/pyloton.py +++ b/CircuitPython_Pyloton/pyloton.py @@ -171,28 +171,15 @@ class Pyloton: blinka_bitmap = "blinka-pyloton.bmp" - # Compatible with CircuitPython 6 & 7 - with open(blinka_bitmap, 'rb') as bitmap_file: - bitmap1 = displayio.OnDiskBitmap(bitmap_file) - tile_grid = displayio.TileGrid(bitmap1, pixel_shader=getattr(bitmap1, 'pixel_shader', displayio.ColorConverter())) - self.loading_group.append(tile_grid) - self.display.show(self.loading_group) - status_heading = label.Label(font=self.arial16, x=80, y=175, - text="Status", color=self.YELLOW) - rect = Rect(0, 165, 240, 75, fill=self.PURPLE) - self.loading_group.append(rect) - self.loading_group.append(status_heading) - - # # Compatible with CircuitPython 7+ - # bitmap1 = displayio.OnDiskBitmap(blinka_bitmap) - # tile_grid = displayio.TileGrid(bitmap1, pixel_shader=bitmap1.pixel_shader) - # self.loading_group.append(tile_grid) - # self.display.show(self.loading_group) - # status_heading = label.Label(font=self.arial16, x=80, y=175, - # text="Status", color=self.YELLOW) - # rect = Rect(0, 165, 240, 75, fill=self.PURPLE) - # self.loading_group.append(rect) - # self.loading_group.append(status_heading) + bitmap1 = displayio.OnDiskBitmap(blinka_bitmap) + tile_grid = displayio.TileGrid(bitmap1, pixel_shader=bitmap1.pixel_shader) + self.loading_group.append(tile_grid) + self.display.root_group = self.loading_group + status_heading = label.Label(font=self.arial16, x=80, y=175, + text="Status", color=self.YELLOW) + rect = Rect(0, 165, 240, 75, fill=self.PURPLE) + self.loading_group.append(rect) + self.loading_group.append(status_heading) def _load_fonts(self): """ @@ -495,7 +482,7 @@ class Pyloton: self.splash.append(sprites) - self.display.show(self.splash) + self.display.root_group = self.splash while self.loading_group: self.loading_group.pop() diff --git a/EInk_CircuitPython_Quickstart/27_tricolor_eink_shield_text/code.py b/EInk_CircuitPython_Quickstart/27_tricolor_eink_shield_text/code.py index 4605002e6..3efb92fc1 100644 --- a/EInk_CircuitPython_Quickstart/27_tricolor_eink_shield_text/code.py +++ b/EInk_CircuitPython_Quickstart/27_tricolor_eink_shield_text/code.py @@ -72,7 +72,7 @@ text_group.append(text_area) # Add this text to the text group g.append(text_group) # Place the display group on the screen -display.show(g) +display.root_group = g # Refresh the display to have everything show on the display # NOTE: Do not refresh eInk displays more often than 180 seconds! diff --git a/FunHouse_Fume_Extractor/code.py b/FunHouse_Fume_Extractor/code.py index f5403de7d..e05999784 100644 --- a/FunHouse_Fume_Extractor/code.py +++ b/FunHouse_Fume_Extractor/code.py @@ -74,7 +74,7 @@ fan_text = funhouse.add_text( text_font="fonts/Arial-Bold-24.pcf", ) # showing graphics -funhouse.display.show(funhouse.splash) +funhouse.display.root_group = funhouse.splash # state machines run = False # state if main code is running diff --git a/MagTag/MagTag_Google_Calendar/authenticator.py b/MagTag/MagTag_Google_Calendar/authenticator.py index 5d2f8ebef..b008b2da2 100755 --- a/MagTag/MagTag_Google_Calendar/authenticator.py +++ b/MagTag/MagTag_Google_Calendar/authenticator.py @@ -81,7 +81,7 @@ label_verification_url.text = ( label_user_code.text = "2. Enter code: %s" % google_auth.user_code graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=240, y=70) -graphics.display.show(graphics.splash) +graphics.display.root_group = graphics.splash display.refresh() # Poll Google's authorization server diff --git a/MatrixPortal_S3_Flight_Proximity_Tracker/code.py b/MatrixPortal_S3_Flight_Proximity_Tracker/code.py index c282173a0..b3dc39f96 100755 --- a/MatrixPortal_S3_Flight_Proximity_Tracker/code.py +++ b/MatrixPortal_S3_Flight_Proximity_Tracker/code.py @@ -269,7 +269,7 @@ def update_display_with_flight_data(flight_data, icon_group, display_group): display_group.append(icon_group) # Show the updated group on the display - display.show(display_group) + display.root_group = display_group display.refresh() return text_labels @@ -287,7 +287,7 @@ def display_no_flights(): main_group.append(looking_label) # Update the display with the new group - display.show(main_group) + display.root_group = main_group display.refresh() diff --git a/Matrix_Bluetooth_Controlled_LED_Sign/code.py b/Matrix_Bluetooth_Controlled_LED_Sign/code.py index a0ac8b2cd..68edce13c 100755 --- a/Matrix_Bluetooth_Controlled_LED_Sign/code.py +++ b/Matrix_Bluetooth_Controlled_LED_Sign/code.py @@ -50,7 +50,7 @@ def update_display(text, color=0xFFFFFF): text_area.x = display.width text_area.y = 13 main_group.append(text_area) - display.show(main_group) + display.root_group = main_group while True: print("WAITING...") diff --git a/PyPortal/PyPortal_Google_Calendar/authenticator/code.py b/PyPortal/PyPortal_Google_Calendar/authenticator/code.py index 6aef41560..c27357982 100644 --- a/PyPortal/PyPortal_Google_Calendar/authenticator/code.py +++ b/PyPortal/PyPortal_Google_Calendar/authenticator/code.py @@ -78,7 +78,7 @@ label_user_code.text = "2. Enter code: %s" % google_auth.user_code # Create a QR code graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=170, y=165) -graphics.display.show(graphics.splash) +graphics.display.root_group = graphics.splash # Poll Google's authorization server print("Waiting for browser authorization...") diff --git a/PyPortal/PyPortal_Titano_Weather_Station/code.py b/PyPortal/PyPortal_Titano_Weather_Station/code.py index bf8041eb7..9628aca9f 100644 --- a/PyPortal/PyPortal_Titano_Weather_Station/code.py +++ b/PyPortal/PyPortal_Titano_Weather_Station/code.py @@ -206,7 +206,7 @@ while True: print("trash time") alarm = True if alarm and not dismissed and not snoozed: - display.show(alarm_gfx[w]) + display.root_group = alarm_gfx[w] pyportal.play_file(alarm_sounds[w]) mode = w print("mode is:", mode) @@ -216,7 +216,7 @@ while True: if time_str == alarm_checks[a]: alarm = True if alarm and not dismissed and not snoozed: - display.show(alarm_gfx[a]) + display.root_group = alarm_gfx[a] pyportal.play_file(alarm_sounds[a]) mode = a print(mode) @@ -244,13 +244,13 @@ while True: print("pressed dismiss button") dismissed = True alarm = False - display.show(pyportal.splash) + display.root_group = pyportal.splash touched = time.monotonic() mode = mode if not switch_snooze.value and not phys_snooze: phys_snooze = True print("pressed snooze button") - display.show(pyportal.splash) + display.root_group = pyportal.splash snoozed = True alarm = False touched = time.monotonic() @@ -265,7 +265,7 @@ while True: if touch: if snooze_buttons[button_mode].contains(touch) and not touch_button_snooze: print("Touched snooze") - display.show(pyportal.splash) + display.root_group = pyportal.splash touch_button_snooze = True snoozed = True alarm = False @@ -275,7 +275,7 @@ while True: print("Touched dismiss") dismissed = True alarm = False - display.show(pyportal.splash) + display.root_group = pyportal.splash touch_button_dismiss = True touched = time.monotonic() mode = mode @@ -294,6 +294,6 @@ while True: snoozed = False alarm = True mode = mode - display.show(alarm_gfx[mode]) + display.root_group = alarm_gfx[mode] pyportal.play_file(alarm_sounds[mode]) print(mode) diff --git a/TFT_FeatherWing_TSC2007_Demos/CircuitPython/code.py b/TFT_FeatherWing_TSC2007_Demos/CircuitPython/code.py index c2c9ba604..35a883571 100644 --- a/TFT_FeatherWing_TSC2007_Demos/CircuitPython/code.py +++ b/TFT_FeatherWing_TSC2007_Demos/CircuitPython/code.py @@ -50,7 +50,7 @@ for i in range(len(images)): index = 0 touch_state = False -display.show(groups[index]) +display.root_group = groups[index] while True: if tsc.touched and not touch_state: @@ -59,11 +59,11 @@ while True: # left side of the screen if point["y"] < 2000: index = (index - 1) % len(images) - display.show(groups[index]) + display.root_group = groups[index] # right side of the screen else: index = (index + 1) % len(images) - display.show(groups[index]) + display.root_group = groups[index] touch_state = True if not tsc.touched and touch_state: touch_state = False diff --git a/TFT_Shield_TSC2007_Demos/CircuitPython/code.py b/TFT_Shield_TSC2007_Demos/CircuitPython/code.py index d24e070ae..b490f4c8d 100644 --- a/TFT_Shield_TSC2007_Demos/CircuitPython/code.py +++ b/TFT_Shield_TSC2007_Demos/CircuitPython/code.py @@ -54,7 +54,7 @@ for i in range(len(images)): index = 0 touch_state = False -display.show(groups[index]) +display.root_group = groups[index] while True: if tsc.touched and not touch_state: point = tsc.touch @@ -65,10 +65,10 @@ while True: # left side of the screen if point["y"] < 2000: index = (index - 1) % len(images) - display.show(groups[index]) + display.root_group = groups[index] # right side of the screen else: index = (index + 1) % len(images) - display.show(groups[index]) + display.root_group = groups[index] if not tsc.touched and touch_state: touch_state = False