Problem with refresh rate with 2050 Adafruit display 3.5"

Hi,
I’m new to all this, so please do not judge if I made some stupid mistakes in my code.
Long story short.
I was able to get proper display functioning with cheap 0.96" display I found on Ebay for $4.
When I try to do same thing with Adafruit 2050 TFT in 8 bit mode.
LCD 3.5" Adafruit 2050
I get either blinking screen (slow refresh rate) or screen does not refresh at all (in my case numbers on top of each other), all depends where I place the display properties in my setup. Also to mention I did try first the SPI mode, same result.
Purpose of the code is to read the analog voltage on A0 and display it on the screen, simple as that.
Wiring is per pdf file found on the Adafruit website.

#include <Wire.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A5 // LCD Read goes to Analog 5
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF

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

const int SwitchPin = 11;
int SwitchState = 0;

void setup(void) {
tft.reset();
uint16_t identifier = tft.readID();
tft.begin (identifier);
tft.setRotation(3);
tft.fillScreen(CYAN);

pinMode(11, OUTPUT); }


void loop(void) {
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
float max_volt = voltage;
for (int i=0; i<200;i++) {
sensorValue = analogRead(A0);
voltage = sensorValue * 5.0;
SwitchState = digitalRead(SwitchPin);

if (voltage < 750.0) 
voltage = 0.0; 
if (voltage > max_volt) {
max_volt = voltage; }
if (max_volt > 1500) 
digitalWrite(11, HIGH); 
else 
digitalWrite(11, LOW); } 


tft.setTextColor (BLACK);
tft.setCursor(15,50); 
tft.setTextSize(19);
tft.print(max_volt, 0);
delay (50); 

tft.setTextColor (RED); 
tft.setCursor(25,230); 
tft.setTextSize(8.5);
if (max_volt > 1500) 
tft.print ("STOP");
delay (50);

}

Life is much simpler if you post a link to your actual display
Please place any code within a CODE window. You can go back and edit your post with the More: [Modify] button. Select the code, click on the [</>] icon

I do not have this item. But I am sure that Adafruit will provide good documentation with working examples.

If you have a problem, compose your question carefully. 10 minutes of your time will often mean you get an accurate solution within an hour or two.

Your code “looks” fine. I suggest that you post a clear photo of your actual wiring.

David.

Got it
Simple as tft.setTextColor (textColor, Black)

Here is the code

#include <Wire.h>
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A5 // LCD Read goes to Analog 5
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

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


 const int SwitchPin = 11;
 int SwitchState = 0;

void setup() {
  uint32_t identifier = tft.readID();
  tft.begin(identifier);
  tft.setRotation(3);
 tft.fillScreen(BLACK);



 pinMode(11, OUTPUT); }
 
void loop() {
 int sensorValue = analogRead(A0);
 float voltage = sensorValue * (5.0 / 1023.0);
 float max_volt = voltage;
 for (int i=0; i<200;i++) 
 sensorValue = analogRead(A0);
 voltage = sensorValue * 5.0;
 SwitchState = digitalRead(SwitchPin);
 
  if (voltage < 1000.0) 
 voltage = 0.0; 
  if (voltage > max_volt) 
 max_volt = voltage; 
  if (max_volt > 1500) 
 digitalWrite(11, HIGH); 
 else 
 digitalWrite(11, LOW);  

 tft.setTextColor (GREEN, BLACK);
 tft.setCursor(15,50); 
 tft.setTextSize(19.9);
 tft.print(max_volt, 0);

 tft.setTextColor (RED, BLACK); 
 tft.setCursor(25,230); 
 tft.setTextSize(8.5);
  if (max_volt > 1500) 
 tft.print ("STOP");
 else {
 tft.setTextColor (WHITE, BLACK);
 tft.print ("RUNNING  "); }
 
 }