ILLI9341 works fine - almost #2815
Replies: 2 comments
-
The Arduino working environment prevents #defines in the main program (sketch) from being visible to the library. I suspect the same problem occurs with PlatformIO. This is a build environment problem and not something I can solve. To see if a setup is being picked up by the library, run the Read_User_Setup sketch. |
Beta Was this translation helpful? Give feedback.
-
Thank you Bodmer for the extremely quick response. I tested the Read_User_setup sketch in two variants, one without #include "User_Setup.h" and one with it. Both variants show that you are right with your assumption. No values are taken from the compiler. Here is the result: [code] MOSI = GPIO 13 //23 Values as set in User_Setup Font GLCD loaded Display SPI frequency = 27.00 I'm just a simple hobby C++ programmer who unfortunately doesn't understand anything about the inner workings of the Arduino or PlatformIO development environments. Thank you for your explanation and support |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Unfortunately I still have a problem with an ILLI9341 display and the TFT_eSPI lib.
I'm using an esp32doit-devkit-v1 processor and compiling the 320x240/TFT_Meters example with VScode/PlatformIO
Everything works fine *) if I don't include the Users_Setup.h file and instead make the following entries in platformio.ini:
build_flags =
-D USER_SETUP_LOADED
-D ILI9341_DRIVER
-D TFT_MISO=19
-D TFT_MOSI=23
-D TFT_SCLK=18
-D TFT_CS=15
-D TFT_DC=2
-D TFT_RST=4
-D LOAD_GLCD=1
-D LOAD_FONT2
-D LOAD_FONT4 ; -1
-D LOAD_FONT6
-D LOAD_FONT7
-D LOAD_FONT8
-D LOAD_GFXFF
-D SMOOTH_FONT
-D SPI_FREQUENCY=27000000
lib_deps = bodmer/TFT_eSPI@^2.5.31
It makes me confident because it proves that the display and the wiring are fine.
After I adapted the User_Setup.h for the ILLY9341 in a second step, inserted of #include "User_Setup.h" in the main program and removed all build_flags from the platforio.in, the display unfortunately remains empty with a gray background.
here all active entries in User_Setup.h
#define USER_SETUP_INFO "User_Setup"
#define ILI9341_DRIVER // Generic driver for common displays
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
#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_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
#define SPI_FREQUENCY 27000000
#define SPI_READ_FREQUENCY 20000000
#define SPI_TOUCH_FREQUENCY 2500000
There are no compile errors and upload works fine when the program starts. :-((
Thank you for every hint, maybe it will help other users as well
*) Solely tft.invertDisplay(x); would still have to be adjusted.
Beta Was this translation helpful? Give feedback.
All reactions