Scroll number from bottom to top or vice versa

Hello!
I need a little help. How could I make the number be changed in the same way as on a water, gas,... scrolling from bottom to top or vice versa.
I have a starting example:

#include <UTFT.h>

UTFT myGLCD(CTE40, 38, 39, 40, 41);

extern uint8_t Arial_round_16x24[];

int counter = 0;

void setup()
{
  myGLCD.InitLCD(1);
  myGLCD.clrScr();
}
void loop(){
  if ( counter < 10 ){
    counter += 1;
  }
  if (counter == 10){
    counter = 0;
  }
  delay (1000);
  myGLCD.setFont(Arial_round_16x24); // 40x40
  myGLCD.setColor(0, 218, 240);
  myGLCD.printNumI(counter, 5, 5);
}

What are the three parameters of this function call, and what do they do?

counter is a variable that changes every second from 0 to 9 "counter += 1;" , the first 5 after the counter is the beginning of the column where the "counter" variable is displayed, and the second 5 is the line where the "counter" variable is displayed.

What happens if you were to vary the line parameter? Couldn't you use that to do your scrolling?

I moved your topic to an appropriate forum category @va_cristi.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

You mean like this? :

1 Like

Some devices will let you print the first line of text on the bottom row and automatically line feed (scroll) to fit added text.

dougp, Yes. This is the idea. I will try to see if I can make some changes. Thank you!

Just to be sure, note that the link shows the technique for an LCD, not TFT.

Yes. I saw. I said that I can change something there. But I'm a beginner and I'm just catching my ears.
I found something else interesting, but here too it's complicated for me:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.