From 16120f16381f4eb130c7453ace3efeb9a96e5073 Mon Sep 17 00:00:00 2001 From: Paul Cutler Date: Fri, 3 Nov 2023 10:26:11 -0500 Subject: [PATCH] Update to use fourwire and root_group for CP 9 compatibility --- README.rst | 3 ++- examples/ssd1325_gamma.py | 5 +++-- examples/ssd1325_simpletest.py | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 5c59922..8953a80 100644 --- a/README.rst +++ b/README.rst @@ -63,6 +63,7 @@ Usage Example import board import busio import displayio + import fourwire import adafruit_ssd1325 displayio.release_displays() @@ -73,7 +74,7 @@ Usage Example tft_dc = board.D8 tft_reset = board.D7 - display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset, + display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset, baudrate=1000000) time.sleep(1) display = adafruit_ssd1325.SSD1325(display_bus, width=128, height=64) diff --git a/examples/ssd1325_gamma.py b/examples/ssd1325_gamma.py index 98767e1..7bb4614 100644 --- a/examples/ssd1325_gamma.py +++ b/examples/ssd1325_gamma.py @@ -4,6 +4,7 @@ import time import board import displayio +import fourwire import adafruit_ssd1325 displayio.release_displays() @@ -13,7 +14,7 @@ oled_dc = board.D6 oled_reset = board.D9 -display_bus = displayio.FourWire( +display_bus = fourwire.FourWire( spi, command=oled_dc, chip_select=oled_cs, reset=oled_reset, baudrate=1000000 ) time.sleep(1) @@ -40,6 +41,6 @@ g.append(t) -display.show(g) +display.root_group = g time.sleep(10) diff --git a/examples/ssd1325_simpletest.py b/examples/ssd1325_simpletest.py index 3d2b452..e44b2c3 100644 --- a/examples/ssd1325_simpletest.py +++ b/examples/ssd1325_simpletest.py @@ -8,6 +8,7 @@ import board import displayio +import fourwire import terminalio from adafruit_display_text import label import adafruit_ssd1325 @@ -18,7 +19,7 @@ spi = board.SPI() oled_cs = board.D5 oled_dc = board.D6 -display_bus = displayio.FourWire( +display_bus = fourwire.FourWire( spi, command=oled_dc, chip_select=oled_cs, baudrate=1000000, reset=board.D9 ) @@ -36,7 +37,7 @@ # Make the display context splash = displayio.Group() -display.show(splash) +display.root_group = splash color_bitmap = displayio.Bitmap(display.width, display.height, 1) color_palette = displayio.Palette(1)