2.4 inch TFT text overlapping

My Hardware and libraries follows

Arduino Mega
Display 2.4 inch TFT
SPFD5408
(0x9328)

analog_value = analogRead(A12);
temp = (analog_value * 5.0/10) / 1024.0;

voltage = temp/(0.0909);
if (voltage < 0.1)
{
voltage=0.0;
}

Serial.println (voltage);
delay(2000);
tft.setTextSize(4);
tft.setTextColor(RED);
tft.setCursor(18,160);
tft.print(voltage);
}

My problem is the float value "Voltage is coming on screen but when the delay time works and new reading comes the value displayed is over lapping .... i dont know to refresh the screen and display the new reading from the analog pin (voltage).

please help me
Thank you.

It caused by fonts design - it are transparent and do not have a background.
So if you want to display the new value in the place - you should clean it before/ The simplest method for it - to draw rectange with background color, covering the letters that you want to delete.

thank you Sir, let me try it, will update u soon :grinning:

Wow .... thats working .... :star_struck: :smiley:

please mark your problem as "solved"

Yes the problem is solved. but where do i mark it ....any button or option ??, pls. guide me.

It's at the bottom of every reply. click on the one that provided the solution.

Oh and you can also just print spaces instead of drawing a rectangle

thank u buddy :grinning:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.