Skip to content
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

9x compatibility and rename examples #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
import time
import board
import displayio

# 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

import terminalio
from adafruit_hx8357 import HX8357
from adafruit_button import Button
Expand All @@ -23,7 +31,7 @@
tft_cs = board.D9
tft_dc = board.D10

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs)
# display is rotated to align x, y with touch screen x, y
display = HX8357(display_bus, width=320, height=480, rotation=270)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@

import board
import displayio

# 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

from adafruit_hx8357 import HX8357
import adafruit_ft5336

Expand All @@ -20,7 +28,7 @@
tft_cs = board.D9
tft_dc = board.D10

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs)
# display is rotated to align x, y with touch screen x, y
display = HX8357(display_bus, width=320, height=480, rotation=90)

Expand Down
Loading