0

Vertical Scrolling of TFT display(ILI9340/41)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Vertical Scrolling of TFT display(ILI9340/41)

by KurtE on Tue Jun 24, 2014 1:35 pm

Has anyone experimented with and hopefully has some example code that does vertical scrolling on one of the TFT displays. Currently I have a couple of different displays I am experimenting with, including 2 of the 2.8" TFT display(one shield, one breakout) which has the ILI9341 chipset as well as well as a 2.2" TFT breakout with the ILI9340. I also have one of the 1.8" tft shields, but it's controller (ST7735R) looks like it is significantly different.

Looks like both of these have some abilities to do vertical scrolling using the commands Vertical Scroll Definition (0x33) as well as the Vertical Scroll Start Address (0x37).

What I would like to do is to use one of these displays as a simple display terminal on one of my robots, and when I output text, the screen scrolls up and the new line of text is displayed on the bottom. If I use a display that has touch, may reserve parts of the screen for things like some buttons or the like.

But before I start playing with this, thought I would see if someone has already done something like this.

Thanks
Kurt

KurtE
 
Posts: 23
Joined: Fri Apr 25, 2014 8:10 pm

Re: Vertical Scrolling of TFT display(ILI9340/41)

by KurtE on Wed Jun 25, 2014 5:53 pm

Not sure if anyone is interested in this or not, but have a few things working now with this. I have a simple test app that so far scrolls lines of text, with two lines of text at the top that does not scroll. This is in the default orientation of the screen. Still need to learn what it does when I change the orientation of th escreen.

I wish there was a simple set of functions that simply moved the memory instead of what this does, which is to remap where things map which memories get displayed where on the display.

That is if I do something like change vertical scroll start, I have to use that fact with to know which actual logical pixels I need to draw in to show up at the appropriate place on the display. In case anyone is interested I have include the WIP test case...
Attachments
Scroll_Test_ILI9340-140625a.zip
(1.57 KiB) Downloaded 634 times

KurtE
 
Posts: 23
Joined: Fri Apr 25, 2014 8:10 pm

Re: Vertical Scrolling of TFT display(ILI9340/41)

by KurtE on Thu Jun 26, 2014 8:48 pm

Still playing here with this. In many cases I am not sure how generically useful this will be. Normally I like using my display with a horizontal orientation.
tft.setRotation(1); // Or maybe 3 depending on how I mount the display.

However it appears like the vertical scroll is only valid in one direction. I will still play around some as I may be missing something. But when I set the rotation to anything but 0, the scrolling does not work as I would like. I was hoping for example if I try to set the display horizontal, that I could may be set a logical vertical scroll region, where maybe the vertical scroll definition (TFA+BFA+Scroll region) would maybe add up to 240 instead of 320. Tried it, and nothing happened. But if instead I still add it up to 320, things did scroll, but it was text in each line, instead of all of the text scrolling up a line. So that part I may have to punt on...

Was worth a try.

KurtE
 
Posts: 23
Joined: Fri Apr 25, 2014 8:10 pm

Re: Vertical Scrolling of TFT display(ILI9340/41)

by mahatmajman on Tue Jul 08, 2014 5:20 am

Hey Kurt, this is exactly what I have been looking for - just been through the ILI9340 datasheet and trying to figure out how to get this going. I will give your code a try and see where I can get with this, would be good to add this feature to the Adafruit_ILI9340 library.
mahatmajman
 
Posts: 1
Joined: Tue Jul 08, 2014 5:18 am

Re: Vertical Scrolling of TFT display(ILI9340/41)

by malbro on Wed Oct 29, 2014 1:30 pm

Hi

To get vertical scrolling working correctly in rotation 1 or 3 change the value 320 to 240 in function SendVerticalScrollDefinition(), when you rotate the screen width and height change values, you can get the correct value by using .height() which updates automatically as the screen is rotated.

WriteData16(tft.height()-(wTFA+wBFA));

regards

malbro
 
Posts: 1
Joined: Wed Oct 29, 2014 1:26 pm

Re: Vertical Scrolling of TFT display(ILI9340/41)

by vitormhenrique on Thu Jan 01, 2015 4:04 pm

Does anybody know how to get horizontal scroll with the screen rotated?

vitormhenrique
 
Posts: 28
Joined: Tue Jul 23, 2013 2:48 pm

Please be positive and constructive with your questions and comments.