Skip to content

Commit

Permalink
Merge pull request #11 from prcutler/main
Browse files Browse the repository at this point in the history
Update with root_group and fourwire for CP 9 compatibility
  • Loading branch information
dhalbert authored Nov 3, 2023
2 parents 40348f2 + 01c783d commit ddd258f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Usage Example
import time
import board
import displayio
import fourwire
import adafruit_uc8151d
displayio.release_displays()
Expand All @@ -111,7 +112,7 @@ Usage Example
epd_reset = board.D5
epd_busy = None
display_bus = displayio.FourWire(
display_bus = fourwire.FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)
Expand All @@ -127,7 +128,7 @@ Usage Example
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)
display.show(g)
display.root_group = g
display.refresh()
Expand Down
5 changes: 3 additions & 2 deletions examples/uc8151d_1.54_grayscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import board
import displayio
import busio
import fourwire
import adafruit_uc8151d

displayio.release_displays()
Expand All @@ -25,7 +26,7 @@
rst = board.GP12
busy = board.GP13

display_bus = displayio.FourWire(
display_bus = fourwire.FourWire(
busio.SPI(clk, si), command=dc, chip_select=cs, reset=rst, baudrate=1000000
)

Expand Down Expand Up @@ -64,5 +65,5 @@
g = displayio.Group()
t = displayio.TileGrid(bitmap, pixel_shader=palette)
g.append(t)
display.show(g)
display.root_group = g
display.refresh()
5 changes: 3 additions & 2 deletions examples/uc8151d_2.9_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import time
import board
import displayio
import fourwire
import adafruit_uc8151d

# Used to ensure the display is free in CircuitPython
Expand All @@ -24,7 +25,7 @@
epd_busy = board.D6

# Create the displayio connection to the display pins
display_bus = displayio.FourWire(
display_bus = fourwire.FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1) # Wait a bit
Expand Down Expand Up @@ -55,7 +56,7 @@
g.append(t)

# Place the display group on the screen
display.show(g)
display.root_group = g

# Refresh the display to have it actually show the image
# NOTE: Do not refresh eInk displays sooner than 180 seconds
Expand Down
5 changes: 3 additions & 2 deletions examples/uc8151d_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import time
import board
import displayio
import fourwire
import adafruit_uc8151d

displayio.release_displays()
Expand All @@ -25,7 +26,7 @@
epd_reset = board.D5
epd_busy = None

display_bus = displayio.FourWire(
display_bus = fourwire.FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)
Expand All @@ -41,7 +42,7 @@
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

display.show(g)
display.root_group = g

display.refresh()

Expand Down

0 comments on commit ddd258f

Please sign in to comment.