ITDB02_Graph16 library flicker when update problem on 3.2 TFT LCD [SOLVED]

First post, first Arduino project. Hope this isn’t too ignorant of a question.

I’m working on a automotive instrument cluster replacement for a vintage truck. What I decided on was 4 analog gauges with GM stepper motors made for this purpose, and a center display screen for odometer, fuel level bar-graph, voltage level digits on this display. I’m using the 3.2" TFT LCD screen I’m sure you’ve all seen on Ebay because it gives me a lot of extra real estate for future customization and add-ons while still fitting the limited area I have to work with.

I have one small issue that I can’t seem to work around, hoping someone has an idea for me that I haven’t thought of yet. My issue is updating the bar-graph. I’m doing a fillRect to paint the width of the bar based on a map of the sensor to get the proper horizontal width to correspond with the current fuel level. Easy, works great. The problem is updating the thing and painting a new bar based on subsequent sensor samples.

At first I tried clrScr, but that was way too flashy- it would have put me in an epileptic seizure with a fast enough refresh rate. So I tried just repainting the previous bar with another rectangle at background color before writing the next bar to proper width. That’s a lot better, but still not great. Now I just have the bar flickering.

Is there another way in code to mitigate the flicker, or maybe a more suitable display type for what I’m trying to do?

TIA/Steve C.

Your TFT screen uses the ITDB02 libraries and not the UTFT, UTouch libraries? You can use my library, but I would need to give you my “old” version. Have you tried to use the UTFT libraries with your display yet?

Let me know exactly what you have.

I'm using the older library just because I came across that one first, and I still and too much of a n00b to do a quick and easy install of libraries in the right place to mess with something that is working.

As it turns out, I came up with the answer to my own question about 5 minutes after walking away from the code.

I get the flicker because I'm overwriting the whole bar with background, then repainting it with the new length. Stupid.

Obvious answer is to just repaint the part of the bar on the right that goes away with the next update with a single filRec at background color.

So it was a dumb question to begin with, sorry...

Ok, great. in your first post, add to the beginning of the subject line, [SOLVED]

Thanks, done. I just had to figure out scope of variables w/Arduino to make the fix work, and it has indeed eliminated the flicker issue.