Skip to content

Commit 6e9b42b

Browse files
authored
Merge pull request #2647 from FoamyGuy/new_displayio_api
displayio api updates for 9.x+
2 parents 5d047d9 + 79ce736 commit 6e9b42b

File tree

200 files changed

+318
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+318
-369
lines changed

4x4_MIDI_Messenger/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
5555

5656
splash = displayio.Group()
57-
display.show(splash)
57+
display.root_group = splash
5858
font = bitmap_font.load_font('/OCRA_small.pcf')
5959
# main label/MIDI message name text; centered
6060
main_area = label.Label(

AHT20_OLED/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
# Make the display context
3232
splash = displayio.Group()
33-
display.show(splash)
33+
display.root_group = splash
3434

3535
text = "hello world"
3636
text_area = label.Label(terminalio.FONT, color=0xFFFF00, x=15, y=0)

Adafruit_Feather_TFT_ESP32-S2/TFT_GitHub_Stars/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
text_area.x = 135
3636
text_area.y = 90
3737
group.append(text_area)
38-
display.show(group)
38+
display.root_group = group
3939

4040
# Connect to WiFi
4141
print("Connecting to %s"%secrets["ssid"])

Adafruit_Feather_TFT_ESP32-S2/TFT_Hello_World/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
text_area = bitmap_label.Label(terminalio.FONT, text=text, scale=scale)
1616
text_area.x = 10
1717
text_area.y = 10
18-
board.DISPLAY.show(text_area)
18+
board.DISPLAY.root_group = text_area
1919

2020
while True:
2121
pass

Adafruit_Feather_TFT_ESP32-S2/TFT_bitmap_display/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
tile_grid = TileGrid(bitmap=blinka_img, pixel_shader=blinka_img.pixel_shader)
1313
main_group.append(tile_grid)
1414

15-
board.DISPLAY.show(main_group)
15+
board.DISPLAY.root_group = main_group
1616

1717
tile_grid.x = board.DISPLAY.width // 2 - blinka_img.width // 2
1818

Adafruit_Feather_TFT_ESP32-S2/TFT_simple_sensor_data/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
print("IC version:", hex(sensor.ic_version))
2929

30-
board.DISPLAY.show(main_group)
30+
board.DISPLAY.root_group = main_group
3131

3232
while True:
3333
text_area.text = "Battery:\n{:.1f} Volts \n{}%".format(sensor.cell_voltage, sensor.cell_percent)

Baudot_TTY/baudot_tty_GUI/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
dot = Circle(220, 60, 8, outline=VFD_GREEN, fill=VFD_BG)
8686
screen.append(dot)
8787

88-
clue.display.show(screen)
88+
clue.display.root_group = screen
8989

9090
# constants for sine wave generation
9191
SIN_LENGTH = 100 # more is less choppy

Buckaroo_Plant_Care_Bot/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
text_group.append(motor_label)
7272

7373
clue_display.append(text_group)
74-
board.DISPLAY.show(clue_display)
74+
board.DISPLAY.root_group = clue_display
7575

7676
motor = DigitalInOut(board.P2)
7777
motor.direction = Direction.OUTPUT

CLUE_Altimeter/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
# create main display group
4444
splash = displayio.Group()
45-
clue.display.show(splash)
45+
clue.display.root_group = splash
4646

4747
# background
4848
bg_bmp, bg_pal = adafruit_imageload.load(

CLUE_BBQ/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
title_label.y = 120
5454
homescreen_screen.append(title_label)
5555

56-
clue.display.show(homescreen_screen)
56+
clue.display.root_group = homescreen_screen
5757

5858
# Setup temperatures screen
5959
temp_font = bitmap_font.load_font("/font/GothamBlack-25.bdf")
@@ -94,7 +94,7 @@
9494

9595
while True:
9696
# re-display homescreen here
97-
clue.display.show(homescreen_screen)
97+
clue.display.root_group = homescreen_screen
9898

9999
print("Scanning...")
100100
for adv in ble.start_scan(ProvideServicesAdvertisement, timeout=5):
@@ -146,7 +146,7 @@
146146
"Probe", i + 1, "is unplugged",
147147
)
148148
my_labels[i].text = " ---"
149-
clue.display.show(temperatures_screen)
149+
clue.display.root_group = temperatures_screen
150150

151151
except _bleio.ConnectionError:
152152
continue

0 commit comments

Comments
 (0)