scroll text

how to scroll (vertical) through texts in LCD display?

I would suggest to implement a large array of char
char atext[1024] // or what size ever
according to the size you want to scroll through and use it as a ring memory.
Just by setting the start point you then can display strings starting from this point and thus step back and forward through the text.

It depends on why you want to scroll and what type of display that you have.

Most TFT controllers will be able scroll vertically. So text that you have previously written goes out of view at the top of the screen. If your controller is the "same size" as your screen, the text that disappeared off the top will re-enter the bottom.

You would normally "clear" that bottom line before printing new text to it. (Or simply overwrite it with trailing blanks)

As you have probably guessed, all that is happening is that you have a scrolling window on the TFT memory. If you have moved the "top left hand corner", any subsequent graphics or text commands need to bear this in mind.

None of the popular TFT libraries are designed for this. You need to write your own. Yes, the hardware scroll means that your text has "moved" instantly. But the software results of handling a "movable top left hand corner" may give you a headache.

A simple solution is to keep a copy of the text in a ring buffer as suggested by ArthurD. Every time that you "scroll", you have to redraw the whole screen. It is your only solution for controllers that do not have a hardware "vertical scroll".

Some controllers might let you set the RAM "origin" address by the pixel rather than just the scan line.
With this degree of control, you can appear to be scrolling horizontally, vertically, diagonally, ...
As you have gathered, it adds extra software complications for subsequent graphics.

Life would be much simpler if you said which type of display and what controller model number. As well as your intended purpose.

David.

Most TFT controllers will be able scroll vertically.

really?
I have different ILI9225 by UTFT and ILI9341 by Adafruit libs and I nerver observed how to scroll the screen.
Could you show me, please?

Use the "Vertical Scroll" register (0x6A) with the "Base Image Display Control" register (0x61) on an ILI9320 style chip.
These are 0x33 and 0x37 on a ILI9341 style chip.

Manufacturers vary. e.g. Renesas and Samsung.

As I said, I don't think any popular libraries support scrolling.
Perhaps Adafruit do with a SSD1306.

I have never seen an ILI9225. Looking at its data sheet, it uses registers 0x31, 0x32, 0x33.

David.

ArthurD:
I have different ILI9225 by UTFT and ILI9341 by Adafruit libs and I nerver observed how to scroll the screen.
Could you show me, please?

This Instructable may help you.

It is not a feature that is simple to use unless you understand how it works as the x,y coordinates scroll with the screen. Most screens will also only scroll in portrait orientation.

Long story short, you need a buffer array. It's not difficult to do but it does take up a good amount of SRAM which the Arduino lacks.

All you need to know is how long each string will be and which indexes to show. Basically it's just math.