Hi all,
I am trying to use a 240x240 ST7789 TFT display with an ESP32, and I am stuck, it simply wont work. I have tried the adafruit GFX library, it compiled but nothing was showing on the screen. Then I have seen most tutorials (like this one) were using the TFT_eSPI pibrary. So I did as they advised and setup macros as build flags in my platformio.ini file. I get a whole lot of errors from std not being a template. Maybe its just missing an include for std vectors shared ptrs etc?
here ir a snippet of my errors :
Compiling .pio\build\esp-wrover-kit\libaf7\StandardCplusplus_ID572\eh_globals.cpp.o
In file included from src\main.cpp:1:0:
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:158:12: error: 'std::isinf' has not been declared
using std::isinf;
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:159:12: error: 'std::isnan' has not been declared
using std::isnan;
^
In file included from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream:28:0,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/istream:24,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/complex:20,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572\complex.cpp:19:
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream_helpers: In static member function 'static void std::__ostream_printout<traits, char, float>::printout(std::basic_ostream<char, traits>&, float)':
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream_helpers:250:109: error: there are no arguments to 'dtostrf' that depend on a template parameter, so a
declaration of 'dtostrf' must be available [-fpermissive]
length = strlen(dtostrf(f, static_cast<int>(stream.width()), static_cast<int>(stream.precision()), buffer));
^
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream_helpers:250:109: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of
an undeclared name is deprecated)
In file included from .pio\libdeps\esp-wrover-kit\TFT_eSPI/Processors/TFT_eSPI_ESP32.h:78:0,
from .pio\libdeps\esp-wrover-kit\TFT_eSPI/TFT_eSPI.h:65,
from src\main.cpp:5:
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:37:14: error: 'shared_ptr' in namespace 'std' does not name a template type
typedef std::shared_ptr<FileImpl> FileImplPtr;
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:39:14: error: 'shared_ptr' in namespace 'std' does not name a template type
typedef std::shared_ptr<FSImpl> FSImplPtr;
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:50:22: error: expected ')' before 'p'
File(FileImplPtr p = FileImplPtr()) : _p(p) {
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:83:5: error: 'FileImplPtr' does not name a type
FileImplPtr _p;
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:89:18: error: expected ')' before 'impl'
FS(FSImplPtr impl) : _impl(impl) { }
^
C:\Users\jcbsk\.platformio\packages\framework-arduinoespressif32\libraries\FS\src/FS.h:111:5: error: 'FSImplPtr' does not name a type
FSImplPtr _impl;
^
In file included from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/istream:24:0,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/complex:20,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572\complex.cpp:19:
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream: At global scope:
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/ostream:318:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'
class _UCXXEXPORT basic_ostream<charT,traits>::sentry
^
In file included from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/complex:20:0,
from C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572\complex.cpp:19:
C:\Users\jcbsk\.platformio\lib\StandardCplusplus_ID572/istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'
template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {
^
*** [.pio\build\esp-wrover-kit\libaf7\StandardCplusplus_ID572\complex.cpp.o] Error 1
*** [.pio\build\esp-wrover-kit\src\main.cpp.o] Error 1
==================================================================== [FAILED] Took 5.01 seconds ====================================================================
I did not even start to try writing to the screen, I just want the library to compile first
Here is my .ini and main.cpp files
[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
build_flags =
-DUSER_SETUP_LOADED=1
-DST7735_DRIVER=1
-DTFT_WIDTH=240
-DTFT_HEIGHT=240
-DST7735_BLACKTAB=1
-DTFT_RST=PIN_D4
-DTFT_CS=PIN_D8
-DTFT_DC=PIN_D3
-DLOAD_GLCD=1
-DLOAD_FONT2=1
-DLOAD_FONT4=1
-DLOAD_FONT6=1
-DLOAD_FONT7=1
-DLOAD_FONT8=1
-DLOAD_FONT8N=1
-DLOAD_GFXFF=1
-DSMOOTH_FONT=1
-DSPI_FREQUENCY=27000000
; lib_deps =
; adafruit/Adafruit BusIO@^1.5.0
; adafruit/Adafruit SSD1306@^2.4.0
; adafruit/Adafruit ST7735 and ST7789 Library@^1.6.0
bodmer/TFT_eSPI@^2.3.66
Main file
#include <Arduino.h>
#include <Wire.h>
#include <TFT_eSPI.h>
void setup()
{
}
void loop()
{
}