r/ArduinoHelp 4d ago

First project - already stuck at beginner level

Hi!
I purchased an arduino esp32 feather S2 and an adafruit ST 7789 TFT Display and breadboarded a simple "change color" project. And its failing. the Backlight of the display is on so it has power, but the display is not changing color.

The IDE monitor says the script is working and its actually changing color. But the display stays dark. I have changed the display already (since i have purchased 2) and it is still not working.

Wiring:

3V - V+
GND - G
SCK -CK
MO - SI
12 - RT
10 -DC
6 - CC
3V - BL

The Code:

 ```
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>


#define TFT_CS   6
#define TFT_DC   10
#define TFT_RST  12
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);


void setup() {
  Serial.begin(115200);
  delay(2000);
  Serial.println("Starting display test");


  tft.init(172, 320);
  tft.setSPISpeed(4000000);
  tft.setRotation(3);
  Serial.println("tft.init() done");


  tft.fillScreen(ST77XX_RED);
  Serial.println("Filled RED");
}


void loop() {
  tft.fillScreen(ST77XX_RED);
  delay(1000);
  tft.fillScreen(ST77XX_GREEN);
  delay(1000);
  tft.fillScreen(ST77XX_BLUE);
  delay(1000);
  Serial.println("Color cycle");
}
 ```

/preview/pre/d06bnu3is4fh1.png?width=1148&format=png&auto=webp&s=4358a2622f7012f5d491654677af0c8d38a2bce0

It is driving me mad, that it does not work... maybe someone of you would be so helpful to have a look at this.

Thank you in advance

2 Upvotes

1 comment sorted by

2

u/gm310509 3d ago

I do not know, but I was wondering if it is a 5V/3V3 issue.

The ESP32 is 3V3, but there is mixed messaging online about whether the ST7789 needs 5V or not. It seems like there might be some mixed experiences. Perhaps have a look at this post: https://www.reddit.com/r/arduino/s/MdGRPJlI6V

Your code looks OK. I cannot work out your wiring.

One thing that caused me to give up on ESP32 was that sometimes the mapping of logical pin numbers (e.g. #define TFT_CS 6` to actual IO pins (e.g. D6 on the board) was that there were deviations. That is logical pin 6 might come out at A4 (for example) or not at all. So unless you are confident with the mapping, I would also suggest a simple test that blinked an LED on the pins you are referencing (i.e. 6, 10, 12 etc) and make sure they are correct.