Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aaronchih opened this issue Jun 21, 2018 · 0 comments
Open

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

aaronchih opened this issue Jun 21, 2018 · 0 comments

Comments

@aaronchih
Copy link

aaronchih commented Jun 21, 2018

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);
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant