-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
As the title says, the rotation argument has no effect with the ST7789 driver. Following is my test code. It produces exactly the same output on the screen, regardless of what I put in the rotation argument.
import board
import digitalio
from adafruit_rgb_display import st7789
import time
dc_pin = digitalio.DigitalInOut(board.D6)
rst_pin = digitalio.DigitalInOut(board.D7)
cs_pin = digitalio.DigitalInOut(board.D10)
spi = board.SPI()
disp = st7789.ST7789(
spi,
rotation=90,
width=240,
height=320,
cs=cs_pin,
dc=dc_pin,
rst=rst_pin,
baudrate=24000000,
)
while True:
disp.fill(0)
disp.fill_rectangle(80, 60, 160, 120, 0b1111111111100000)
disp.fill_rectangle(0, 0, 10, 10, 0b0000011111100000)
disp.hline(0, 120, 240, 0b0000000000001111)
disp.vline(160, 120, 160, 0b1111100000000000)
for x in range(0, 320, 10):
disp.pixel(x, 160, 0b1111111111111111)
time.sleep(5)
I'm using the 2.0" TFT found here: https://www.adafruit.com/product/4311
I'm using it with a Fruit Jam, connected to the default SPI port (just SCK and MOSI) and the three pins specified near the top of the code.
All of the drawing operations are working correctly, except that the rotation argument has no effect. The top left corner, in terms of drawing, is in the bottom right corner of the screen, oriented with the pin pads at the bottom and the description text right side up at the top.
Metadata
Metadata
Assignees
Labels
No labels