Closed Jorgen-VikingGod closed 4 years ago
I suspect the probem is that the ST7789 drivers full screen area capability is 240x320 (width x height). The 135x240 screen is a smaller window in this total capability, the top left corner of the screen window is positioned at x,y = 52,40 so the scroll window top y coord must therefore be set to 40 and the bottom to 280.
@Bodmer thx for the hint. But using this offset did not work correctly - got some black lines instead. I reset the example code again and use the 135x240 just with the settings of the 240x320 display and it worked fine out of the box.
I also experienced the same issue with TTGO T-Display (240x135). The problem is addressed in the restriction section of VSCRDEF
command on the datasheet, which states
The condition is TFA+VSA+BFA = 320, otherwise Scrolling mode is undefined. Therefore, we should always assume the display memory as 320 x 240, and customize TFA and BFA to constraint the scrolling area.
Also I found in the builtin driver of ST7789 that the drawing methods are shifted by (52, 40) pixels. So yDraw
should be yStart - 40
.
Here is what I did:
scroll_slow
for new yDraw
yDraw
as 240 - TEXT_HEIGHT
I wanted to try the Matrix Example on the ST7789 1.14" 135x240 - but it seams not to work correctly. (see some random pixel data...
I updated this two methods:
The similar define of
ILI9341_VSCRSADD
is missing in the ST7789 driver header; so I used the same value (0x37) the ILI9341 driver uses.For information - this is my
scroll_slow
method:and here the content of
loop
: