How to avoid superimposed data when printing to an LCD

Hi,

As the title suggests I have an LCD to which I print some data into.

Problem is the new data is printed over the old data.
I also have a problem when changing decimal places, say from 1 to 10 or to 100 as the numbers get printed on top of the text or are not cleared when the counter returns to zero.

Any advice on how to solve this?

/***************************************************
  This is an example sketch for the Adafruit 1.8" SPI display.
  This library works with the Adafruit 1.8" TFT Breakout w/SD card
  ----> http://www.adafruit.com/products/358
  as well as Adafruit raw 1.8" TFT display
  ----> http://www.adafruit.com/products/618
 
  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

//Use these pins for the shield!
#define sclk 13
#define mosi 11
#define cs   10
#define dc   8
#define rst  12

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

    #if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
    #endif


Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);


 
void setup(void) 
  {
  Serial.begin(9600);

  tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
 

  uint16_t time = millis();
  tft.fillScreen(ST7735_BLACK);
  time = millis() - time;

  Serial.println(time, DEC);
  delay(500);

  // large block of text
  tft.fillScreen(ST7735_BLACK);
  }

   
void loop() 

{


  tft.setTextWrap(false);
 
  tft.setCursor(0, 10);
  tft.setTextColor(ST7735_RED);
  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_YELLOW);
  tft.setTextSize(2);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_GREEN);
  tft.setTextSize(3);
  tft.println("Hello World!");
  tft.setTextColor(ST7735_BLUE);
  tft.setTextSize(4);
  tft.print(1234.567);
  delay(1500);
  tft.setCursor(0, 110);
  
  tft.setTextColor(ST7735_WHITE);
  
  tft.setTextSize(1);
  tft.setTextColor(ST7735_GREEN);

 
  tft.setTextColor(ST7735_WHITE);
  tft.println("Sketch has been");
  tft.println("running for: ");
  tft.setTextColor(ST7735_MAGENTA);
  tft.print(millis() / 1000);
  tft.setTextColor(ST7735_WHITE);
  tft.print(" seconds.");
}

Specify a background color for text.

tft.setTextColor(ST7735_WHITE, ST7735_BLACK);

Use a fixed field width padded with spaces as needed.

Nice tip ;)

How would one do this in a HD44780 type display just out of curiosity?

Kind Regards