Recently bought the nueltronics 2,4 TFT LCD screen
My problem is though: When i tried to make a circle that scales according to the analog input from an photoressistor. Ive tried several methods to remove the flicker that comes from updating the circle size, but its always flickering.
first i tried using the build in function called ClearScreen() like
void loop()
{
draw();
tft.ClearScreen(BLACK);
}
But this generated massive flickering, and i understand why because the screen has to reset all the pixels every time it redraws. Adding a delay between the two helped a little but it still flickered.
Secondly i tried using the DrawCircle() function to erase the ring after a small delay in the draw() function. so it went;
Not writing code in full detail as its not needed to understand what i mean.
void draw()
{
uint16_t r = readAnalog(input);
tft.DrawCircle(Size based on r,Color White);
delay(theDelay);
tft.DrawCircle(Size based on r, Color Black);
}
But this also created flicker; even with high delay, considerably less than with the ClearScreen function though.
My last thought is to save the last data and erase the last ring in the next draw.
void draw()
{
uint16_t r = readAnalog(input);
tft.DrawCircle(New Circle,White);
tft.DrawCircle(Old Circle,Black);
unit16_t old = r; <- probably has to be declared globaly so not to be lost inbetween runs.
}
Is there any techniques i can use to get around the flickering, methods i havent tried, or is the limitation on the screen just that great that animation is unfeasable. The screen is capable of drawing 10-15 rings in different size and color in an an instant, so im pretty sure its my inexperience with coding graphics that is limiting me right now.
All feedback is welcome and appreciated.
-Thomas