Skip to content

Commit

Permalink
FourWire support for 8.x.x and 9.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Dec 18, 2023
1 parent 997ef2f commit 71f3fbe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions examples/il0398_4.2_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
import time
import board
import displayio
import fourwire
import adafruit_il0398

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
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 @@ -26,7 +32,7 @@
epd_reset = board.D5
epd_busy = board.D6

display_bus = fourwire.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)
Expand Down
10 changes: 8 additions & 2 deletions examples/il0398_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
import time
import board
import displayio
import fourwire
import adafruit_il0398

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
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 @@ -24,7 +30,7 @@
epd_reset = board.D5
epd_busy = board.D6

display_bus = fourwire.FourWire(
display_bus = FourWire(
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)
time.sleep(1)
Expand Down

0 comments on commit 71f3fbe

Please sign in to comment.