TFT LCD value reset on displej

Hi everybody. I am new on this forum.
So here is My problem.
Trying to display value on LCD but dont know how to write sketchbook. Previous values stay on LCD too.

Here is what i have:

#include <SPFD5408_Adafruit_GFX.h>    // Core graphics library
#include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library


#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#define BLACK   0x0000
#define BLUE    0x001F
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);


float tempC;
int tempPin = 5;

void setup() {
 
tft.begin(0x9341); // SDFP5408

   // Border

drawBorder();

 }
void drawBorder () {

 // Draw a border

 tft.fillScreen(WHITE);
 tft.setCursor (25, 8);
 tft.setTextSize(4);
 tft.setTextColor(BLUE);
 tft.println("TEPLOMER");

}

void loop(){
 
 
 
 tempC = analogRead(tempPin);
 tempC = (5.0 * tempC * 39.8)/1024.0;

 tft.setTextColor(BLACK);
 tft.setCursor (60, 100);
 tft.println(tempC);
 
}

Can somebody please help me how to write it correctly?

arduino_2a8_LCDTFT.ino (823 Bytes)

void drawBorder () {


}

void loop(){

The ONLY argument for putting the { that makes any sense (and not much, at that) is that it saves real estate. Following that with a blank line just looks stupid. Put the damned open curly brace on a new line.

 tft.println("TEPLOMER");

I've never seen an LCD that rode on a carriage. A carriage return and line feed mean nothing to an LCD.

Doesn't the library you are using have a clear screen method?

Yes. The library have....

tft.reset();

but it reset everything and lcd goes white.

Tried this.

void setup() {

tft.begin(0x9341); // SDFP5408

 tft.fillScreen(WHITE);
 tft.setCursor (25, 8 );
 tft.setTextSize(4 );
 tft.setTextColor(BLUE);
 tft.println("TEPLOMER");

}

void loop(){
 
 
 tempC = analogRead(tempPin);
 tempC = (5.0 * tempC * 39.8 )/1024.0;

 tft.setTextColor(BLACK);
 tft.setCursor (60, 100);
 tft.println(tempC);
}

Balator:
Can somebody please help me how to write it correctly?

No, but if you look at the second post in the forum that says, “How to use this forum - please read”, it will tell you how to post it correctly. See the funny sunglasses faces?