Update with fourwire and root_group for CP 9 compatibility
This commit is contained in:
parent
5b9337fbf3
commit
a9d1d6edb4
6 changed files with 18 additions and 12 deletions
|
|
@ -75,6 +75,7 @@ Usage Example
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
displayio.release_displays()
|
displayio.release_displays()
|
||||||
|
|
@ -86,7 +87,7 @@ Usage Example
|
||||||
epd_reset = board.D8 # Set to None for FeatherWing
|
epd_reset = board.D8 # Set to None for FeatherWing
|
||||||
epd_busy = board.D7 # Set to None for FeatherWing
|
epd_busy = board.D7 # Set to None for FeatherWing
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
@ -115,7 +116,7 @@ Usage Example
|
||||||
|
|
||||||
g.append(t)
|
g.append(t)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
display.refresh()
|
display.refresh()
|
||||||
print("refreshed")
|
print("refreshed")
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ Supported products:
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
displayio.release_displays()
|
displayio.release_displays()
|
||||||
|
|
@ -26,7 +27,7 @@ spi = board.SPI() # Uses SCK and MOSI
|
||||||
epd_cs = board.D9
|
epd_cs = board.D9
|
||||||
epd_dc = board.D10
|
epd_dc = board.D10
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
@ -48,7 +49,7 @@ with open("/display-ruler.bmp", "rb") as f:
|
||||||
|
|
||||||
g.append(t)
|
g.append(t)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
display.refresh()
|
display.refresh()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ Supported products:
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
displayio.release_displays()
|
displayio.release_displays()
|
||||||
|
|
@ -29,7 +30,7 @@ epd_dc = board.D22
|
||||||
epd_reset = board.D27 # Set to None for FeatherWing
|
epd_reset = board.D27 # Set to None for FeatherWing
|
||||||
epd_busy = board.D17 # Set to None for FeatherWing
|
epd_busy = board.D17 # Set to None for FeatherWing
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
@ -52,7 +53,7 @@ with open("display-ruler.bmp", "rb") as f:
|
||||||
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||||
g.append(t)
|
g.append(t)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
display.refresh()
|
display.refresh()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ Supported products:
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
displayio.release_displays()
|
displayio.release_displays()
|
||||||
|
|
@ -25,7 +26,7 @@ epd_dc = board.D10
|
||||||
epd_reset = board.D5
|
epd_reset = board.D5
|
||||||
epd_busy = board.D6
|
epd_busy = board.D6
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, baudrate=1000000
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
@ -47,7 +48,7 @@ with open("/display-ruler.bmp", "rb") as f:
|
||||||
|
|
||||||
g.append(t)
|
g.append(t)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
display.refresh()
|
display.refresh()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import time
|
||||||
import board
|
import board
|
||||||
import busio
|
import busio
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import terminalio
|
import terminalio
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
|
|
@ -27,7 +28,7 @@ epd_dc = board.EPD_DC
|
||||||
epd_reset = board.EPD_RESET
|
epd_reset = board.EPD_RESET
|
||||||
epd_busy = board.EPD_BUSY
|
epd_busy = board.EPD_BUSY
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
||||||
)
|
)
|
||||||
display = adafruit_ssd1680.SSD1680(
|
display = adafruit_ssd1680.SSD1680(
|
||||||
|
|
@ -42,7 +43,7 @@ display = adafruit_ssd1680.SSD1680(
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
palette = displayio.Palette(2)
|
palette = displayio.Palette(2)
|
||||||
palette[0] = 0x000000
|
palette[0] = 0x000000
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ Supported products:
|
||||||
import time
|
import time
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
|
import fourwire
|
||||||
import adafruit_ssd1680
|
import adafruit_ssd1680
|
||||||
|
|
||||||
displayio.release_displays()
|
displayio.release_displays()
|
||||||
|
|
@ -29,7 +30,7 @@ epd_dc = board.D10
|
||||||
epd_reset = board.D8 # Set to None for FeatherWing
|
epd_reset = board.D8 # Set to None for FeatherWing
|
||||||
epd_busy = board.D7 # Set to None for FeatherWing
|
epd_busy = board.D7 # Set to None for FeatherWing
|
||||||
|
|
||||||
display_bus = displayio.FourWire(
|
display_bus = fourwire.FourWire(
|
||||||
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
@ -52,7 +53,7 @@ with open("/display-ruler.bmp", "rb") as f:
|
||||||
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
|
||||||
g.append(t)
|
g.append(t)
|
||||||
|
|
||||||
display.show(g)
|
display.root_group = g
|
||||||
|
|
||||||
display.refresh()
|
display.refresh()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue