sumotoy / TFT_ST7735

A fast driver for ST7735 displays that works with Arduino's /All Teensy's/ESP8266/SPARK
69 stars 31 forks source link

How to display a text or graphics without flicker on the TFT LCD #20

Open aaronchih opened 6 years ago

aaronchih commented 6 years ago

I'm building a new device with 1.44" TFT LCD and ATMEGA328. I'm using this library. There are several features like a logo, a button image, and a graph. But I have an issue when text or line display on the TFT LCD. After displaying, and then, refresh and overwrite a text or graph. In this time, there is blinking on the screen, so text and graph are flickering. How can I display statically text and graph without flicker?

`if (count >= 100) { for (uint8_t x = 20; x < 120; x++) { tft.drawPixel(x, vol_1[x - 20] 1 / 5, TFT_BLACK); } uint16_t tmp[99]; memcpy(tmp, &vol_1[1], sizeof(uint16_t) 99); memcpy(vol_1, tmp, sizeof(uint16_t) * 99); vol_1[99] = voltage1 / 10; } else { vol_1[count] = voltage1 / 10; count++; }

for (int16_t y = 0; y < tft.height(); y += 10) { tft.drawFastHLine(0, y, tft.width(), color1); } for (int16_t x = 0; x < tft.width(); x += 10) { tft.drawFastVLine(x, 0, tft.height(), color2); } for (uint8_t x = 20; x < 120; x++) { tft.drawPixel(x, vol_1[x - 20] * 1 / 5, TFT_GREEN); }`