I am using a TFT Display with driver GC9A01 and TFT_eSPI library.
I run my code in the Arduino IDE and it works perfectly. When I use PlatformIO and import the exact same project there is nothing on the display. My wiring remains the same and I am using a the esp-prog to flash the code for both Arduino and PlatformIO.
The code uploads fine and there are no compile errors.
Am I missing something very basic here? This is the Platformio.ini file
How did you configure the TFT_eSPI library for your specific display? By uncommenting header files in .pio/libdeps/esp32dev/TFT_eSPI? I don’t see configuration macros being present in your platformio.ini.
I commented out the correct display in the User_Setup.h file in the TFT_eSPI library
#define GC9A01_DRIVER
#define TFT_HEIGHT 240 // GC9A01 240 x 240
#define TFT_MOSI 23 // In some display driver board, it might be written as "SDA" and so on.
#define TFT_SCLK 18
#define TFT_CS 22 // Chip select control pin
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL 22 // LED back-light
I thought editing the User_Setup.h file was the only thing required to indicate which display is being used?
Do I need to add something else to the platformio.ini file?
I just tested this with some simple code, same result. The display is working fine in Arduino IDE, not working in PlatformIO. The example code I am using shows as expected in the below code, as soon as I flash using Platformio the screen goes black.
#include <Arduino.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
// put your setup code here, to run once:
tft.init();
tft.setRotation(0);
tft.fillScreen(TFT_GREEN);
delay(1000);
}
void loop() {
tft.fillScreen(TFT_BLUE);
delay(1000);
tft.fillScreen(TFT_RED);
delay(1000);
// put your main code here, to run repeatedly:
}
I don’t have my computer here now, because I’m not working! But tomorrow I can send my .ino to you, to show you how I did the configurations!
I had the same issues that you! Maybe it can help you.
I already uninstalled both vscode and platform io and still no joy. The strange thing is I have had this display working with platformio a couple weeks ago
ok, I got the display working (fillscreen test) using platformio.
The code is still not displaying as it should though, i think it is a compiling issue or some configuration in PlatformIO. I will make a new thread with new errors I am facing.