My ST7796S Display is only showing a white screen

Hi Guys, so I made a post a while ago, but I was quite shy because I of course didn't have a lot of information going forward. I took the time to keep pushing myself to find a answer to this problem of mine but to no avail I was still stuck. As of this moment I will describe my setup and show pictures of my setup. The current setup is this, I have an Arduino Uno Rev 4 with Wifi, a motorshield v2 by Adafruit, 3 supersonic sensors, 1 DHT11 sensor (that is currently removed), 4 DC Motors, and now a ST7796S TFT Display.

My current objective is to make a robotic user interface through the Display screen. The truth is I've never used such a display before I've only used simple LCD Screens. In order to get a understanding of how to use this I looked through many tutorials in setting up the TFT screen knowing that the digital pins should not receive no more than 3.3V because if I gave it more than that it would damage the screen, so I did voltage shifting with resistors. similar to this image:

Now with the understanding of such hardware I tried to use several libraries such as the TFT_eSPI library, but still it did not work. I kept searching and searching, looking throughout answers from different forums, until I came upon this forum. A individual having the same issue like I was with their Uno R4 with WiFi, but instead of the display not showing anything it was around touch.

The link to their forums is here: Difficulty interfacing ST7796S TFT display

I recopied their code and updated my hardware setup to potentially match the pins that they used in the answers of the forum.

This is my following code:

#include "FollowBotLCD.h"
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ST7796S_kbv.h"
#include "Arduino.h"

// Universal object
LCDScreen myLCDScreen;

#define TFT_CS        10
#define TFT_DC         9
#define TFT_RST        8
#define TFT_SDA       11
#define TFT_CLK       13
#define TFT_MISO      12

Adafruit_ST7796S_kbv tft = Adafruit_ST7796S_kbv(TFT_CS, TFT_DC, TFT_RST);

#define DOUT A0 /* Data out pin (T_DO) of touch screen */ //3
#define DIN A2 /* Data in pin (T_DIN) of touch screen */ //4
#define DCS 5 /* Chip select pin (T_CS) of touch screen */
#define DCLK 6 /* Clock pin (T_CLK) of touch screen */

#define HMIN 0
#define HMAX 3840
#define VMIN 0
#define VMAX 3840
#define XYSWAP 1 // 0 or 1

#define HRES 480 /* Default screen resolution for X axis */
#define VRES 320 /* Default screen resolution for Y axis */


//#include <TFT_Touch.h>

#define TEXT_SIZE 2


// Constructor
LCDScreen::LCDScreen() {}



// Setup
void LCDScreen::myLCDScreen_Setup() {
    tft.begin();
 

  
  tft.setRotation(1);
  tft.fillScreen(ST7796S_BLACK);
  Serial.println("Setup complete");
  
}

// Loop
void LCDScreen::myLCDScreen_Loop() {

}

Now you might be wondering how this is running, well I am using the PlatformIO extension in VSCode, I have multiple classes. Every loop and setup I have created are necessarily objects being called in the Manager class which is then called in the main.cpp. It Improves readability. If more code is needed to be shared I'll happily do so. But as you can see I'm just trying to project a black screen because all I see currently is a white screen.

This is currently my hardware setup:


I seriously do not know what else to do, I do plan on adding touch functionality so that the user can input specific commands into the device. But before I can even do that I need to make this screen work. If you are wondering what this device is, It's a autonomous robot for our capstone project.

Hi Guys I finally found a way to resolve my problem, I was getting really annoyed in seeing a white screen only, so I kept digging and digging until I came across this youtube video:

They had the same issue like me but resolved it.

Here is the before:

...

//before
void LCDScreen::lcdScreen_setup() {
       tft.begin();
      
      ...
}

And here is the after:

...

//after
void LCDScreen::lcdScreen_setup() {
       tft.begin(0x7796);
      
      ...
}

....

You can imagine the rest of my code is still there. But the biggest change that fixed the problem was including the identifier within the begin function. Apparently each display screen has their own identifier, and for my TFT Display I had to identify it within the tft.begin function. Once I did that it fixed all my problems, and I was able to see a change in the screen from white to black, and from black to blue, and from blue back to white.

1 Like

I wanted to add another disclaimer, the identifier for my board was 0x7796 since I'm using the ST7796S board. So if you are wondering what identifier is on your display, just use the number that's on the name of the board like this: 0x(DisplayNameNumber).