Skip to content

Replace depreciated .show() & displayio changes #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,20 @@ Usage Example
import board
import busio
import displayio
# Starting in CircuitPython 9.x, fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire
import adafruit_ssd1675

displayio.release_displays()

epd_cs = board.D9
epd_dc = board.D10

display_bus = displayio.FourWire(board.SPI(), command=epd_dc, chip_select=epd_cs, baudrate=1000000)
display_bus = FourWire(board.SPI(), command=epd_dc, chip_select=epd_cs, baudrate=1000000)
time.sleep(1)

display = adafruit_ssd1675.SSD1675(display_bus, width=250, height=122, rotation=90)
Expand All @@ -96,7 +102,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
14 changes: 11 additions & 3 deletions adafruit_ssd1675.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@

"""

import displayio
# Starting in CircuitPython 9.x fourwire & EPaperDisplay will be seperate internal
# libraries rather than components of the displayio library
try:
from fourwire import FourWire
from epaperdisplay import EPaperDisplay
except ImportError:
from displayio import FourWire
from displayio import EPaperDisplay


__version__ = "0.0.0+auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_SSD1675.git"
Expand All @@ -53,10 +61,10 @@


# pylint: disable=too-few-public-methods
class SSD1675(displayio.EPaperDisplay):
class SSD1675(EPaperDisplay):
"""SSD1675 driver"""

def __init__(self, bus: displayio.FourWire, **kwargs) -> None:
def __init__(self, bus: FourWire, **kwargs) -> None:
stop_sequence = _STOP_SEQUENCE
try:
bus.reset()
Expand Down
12 changes: 10 additions & 2 deletions examples/ssd1675_2.13_monochrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
import displayio
import adafruit_ssd1675

# Starting in CircuitPython 9.x fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire


displayio.release_displays()

# This pinout works on a Feather M4 and may need to be altered for other boards.
Expand All @@ -22,7 +30,7 @@
epd_reset = board.D5
epd_busy = board.D6

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

display.show(g)
display.root_group = g

display.refresh()

Expand Down
11 changes: 9 additions & 2 deletions examples/ssd1675_four_corners.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
import terminalio
import adafruit_ssd1675

# Starting in CircuitPython 9.x fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

displayio.release_displays()

# This pinout works on a Feather RP2040 EPD and may need to be altered for other
Expand All @@ -27,7 +34,7 @@
epd_reset = board.EPD_RESET
epd_busy = board.EPD_BUSY

display_bus = displayio.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
display = adafruit_ssd1675.SSD1675(
Expand All @@ -41,7 +48,7 @@

# Make the display context
main_group = displayio.Group()
display.show(main_group)
display.root_group = main_group

palette = displayio.Palette(2)
palette[0] = 0x000000
Expand Down
11 changes: 9 additions & 2 deletions examples/ssd1675_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@
import displayio
import adafruit_ssd1675

# Starting in CircuitPython 9.x fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
from fourwire import FourWire
except ImportError:
from displayio import FourWire

displayio.release_displays()

epd_cs = board.D9
epd_dc = board.D10

display_bus = displayio.FourWire(
display_bus = FourWire(
board.SPI(), command=epd_dc, chip_select=epd_cs, baudrate=1000000
)
time.sleep(1)
Expand All @@ -37,7 +44,7 @@
# t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
g.append(t)

display.show(g)
display.root_group = g

display.refresh()

Expand Down