Hello!
I've been trying to get my ESP32 C3 Super mini to work with my TFT Display and I have gotten nothing.
I tried everything that has already been talked in this thread and I even found a video on YouTube from michielbruijn where he changes the ports and has a example code.
I can only get to turn the display's backlight on but that's it.
I don't know if my User_Setup.h may have a problem or the esp32/display.
I also want to point out that my display is a little bit different. Instead of SKL it shows SCK and at the bottom it says "GMT130-V1.0 IPS 240*240" instead of just "IPS 240X240"
In my User_Setup.h I only have uncommented these lines:
Code: Select all
#define USER_SETUP_INFO "User_Setup"
#define ST7789_DRIVER
#define TFT_RGB_ORDER TFT_BGR
#define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
#define TFT_HEIGHT 240 // ST7789 240 x 240
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SPI_FREQUENCY 27000000
The example code is:
Code: Select all
#include <TFT_eSPI.h>
#include <WiFi.h>
// ESP32C3 super mini setup
#define TFT_MISO 5
#define TFT_MOSI 8
#define TFT_SCLK 9
#define TFT_CS -1 // Not connected
#define TFT_DC 2
#define TFT_RST 4 // Connect reset to ensure display initialises
#define TFT_BL 10 // LED back-light control pi
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
TFT_eSPI tft = TFT_eSPI();
void toggleBacklight() {
digitalWrite(TFT_BL, !digitalRead(TFT_BL));
}
void setup(void) {
pinMode(TFT_BL, OUTPUT);
Serial.begin(9600);
Serial.println("ST7789 TFT WiFi Scan Test");
tft.begin(); // initialize a ST7789 chip
tft.setSwapBytes(true); // swap the byte order for pushImage() - corrects endianness
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
toggleBacklight(); // Schakel backlight in
}
void displayWiFiScanResults() {
int n = WiFi.scanNetworks();
tft.fillScreen(TFT_BLACK);
tft.setTextSize(1);
tft.setTextColor(TFT_WHITE);
if (n == 0) {
tft.setCursor(10, 10);
tft.println("No networks found");
} else {
tft.setCursor(10, 10);
tft.print(n);
tft.println(" networks found");
for (int i = 0; i < n; ++i) {
tft.print(i + 1);
tft.print(": ");
tft.print(WiFi.SSID(i));
tft.print(" (");
tft.print(WiFi.RSSI(i));
tft.print(")");
tft.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*");
}
}
}
void loop() {
// delay(1000);
// toggleBacklight(); // Schakel backlight in
// delay(1000);
// toggleBacklight(); // Schakel backlight uit
displayWiFiScanResults(); // Toon WiFi-scanresultaten op het LCD-scherm
// Wacht een tijdje voordat je opnieuw scant
delay(5000);
}
(I have the same cables and pins conected like in the video
https://www.youtube.com/watch?v=TCHKwlc4Oj0 )
I also have my board configured to be an "ESP32C3 Dev Module" with the esp32 downloaded from the Board Manager and the TFT_eSPI library downloaded (and this on the additional boards manager URLs:
https://raw.githubusercontent.com/espre ... index.json ).
I'm pretty new at this type of projects and I'm very lost right now so sorry in advance if the text is too much but I figured that the more information the easier to fix what's happening.