Skip to content

Commit 71f3fbe

Browse files
committed
FourWire support for 8.x.x and 9.x.x
1 parent 997ef2f commit 71f3fbe

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

examples/il0398_4.2_color.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
import time
1515
import board
1616
import displayio
17-
import fourwire
1817
import adafruit_il0398
1918

19+
# Compatibility with both CircuitPython 8.x.x and 9.x.x.
20+
# Remove after 8.x.x is no longer a supported release.
21+
try:
22+
from fourwire import FourWire
23+
except ImportError:
24+
from displayio import FourWire
25+
2026
displayio.release_displays()
2127

2228
# This pinout works on a Feather M4 and may need to be altered for other boards.
@@ -26,7 +32,7 @@
2632
epd_reset = board.D5
2733
epd_busy = board.D6
2834

29-
display_bus = fourwire.FourWire(
35+
display_bus = FourWire(
3036
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
3137
)
3238
time.sleep(1)

examples/il0398_simpletest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212
import time
1313
import board
1414
import displayio
15-
import fourwire
1615
import adafruit_il0398
1716

17+
# Compatibility with both CircuitPython 8.x.x and 9.x.x.
18+
# Remove after 8.x.x is no longer a supported release.
19+
try:
20+
from fourwire import FourWire
21+
except ImportError:
22+
from displayio import FourWire
23+
1824
displayio.release_displays()
1925

2026
# This pinout works on a Feather M4 and may need to be altered for other boards.
@@ -24,7 +30,7 @@
2430
epd_reset = board.D5
2531
epd_busy = board.D6
2632

27-
display_bus = fourwire.FourWire(
33+
display_bus = FourWire(
2834
spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
2935
)
3036
time.sleep(1)

0 commit comments

Comments
 (0)