I need some information for the TFT screen 2.8 and arduino mega. The screen works very well and displays the data. The small problem I encounter is for the text display, the page is reloading every second and this makes a small black screen every second. I would like to know if it was possible to reload only one part of the screen display?
See in video https://youtu.be/vxSa6xkH0vU
My loop()
void loop(void) {
tft.fillScreen(BLACK);
unsigned long start = micros();
tft.setCursor(0, 0);
tft.setRotation(3);
dt = clock.getDateTime();
clock.forceConversion();
// Go
tft.println();
tft.setTextColor(GREEN);
tft.setTextSize(5);
tft.println("Info");
tft.println();
tft.setTextSize(2);
tft.println(clock.dateFormat("d-m-Y H:i:s", dt));
tft.println();
tft.setTextSize(2);
tft.println("Temperature: ");
tft.println(clock.readTemperature());
delay(1000);
}
1 Answer 1
You can use tft.rect(x,y,width,height)
to clear only a portion of the screen. Make sure to set tft.fill
before calling it.
fillscreen
when you don't need to.fillScreen
this generates a dual display :/