ILI9341 or ST7798 display, I'm stuck #2851
MHz000
started this conversation in
Compatible displays and setup files
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I ordered the TFT display shown in the first picture from Aliexpress. It says it is equipped with an ILI9341 or a ST7789V chip.
Tested with the following program I get the output shown in the following pictures on the display.
#include <Arduino.h>
#include <TFT_eSPI.h>
//#include "User_Setup.h"
TFT_eSPI tft = TFT_eSPI();
int maxX, maxY; // display dimensions
int x_0, y_0, radius;
int rotation = 0;
void setup()
{
Serial.begin(115200);
delay(200);
Serial.printf("\nCompiled from: %s at: %s %s", FILE, DATE, TIME);
Serial.println("\nESP32_TFT_240x320_touch_controler");
tft.init();
delay(500);
tft.fillScreen(TFT_BLACK);
tft.invertDisplay(0); // correct colours
for (rotation = 0; rotation < 4; rotation++)
{
tft.setRotation(rotation); // rotat=0 320x480, =1 480x320, =2 320x480, =3 480x320
maxY = tft.width(); // 240 // max display area box
maxX = tft.height(); // 320
Serial.printf("\nrotation %2i width(X) %3i height(Y) %3i", rotation, tft.width(), tft.height());
tft.drawRect(2, 2, maxX - 2, maxY - 2, TFT_RED);
tft.drawLine(2, 2, maxX - 2, maxY - 2, TFT_BLUE);
tft.fillCircle(maxX / 2, maxY / 2, 5, TFT_YELLOW);
tft.setCursor(10, 10);
tft.setTextColor(TFT_GREEN);
tft.setTextSize(2);
tft.printf("rotation %i ", rotation);
tft.setCursor(10, 30);
tft.printf("size %i * %i", tft.width(), tft.height());
delay(1000);
while(true){}
tft.fillScreen(TFT_BLACK);
}
}
void loop()
{
// put your main code here, to run repeatedly:
}
Here you can see that regardless of the orientation, only the upper two-thirds of the display are used, the rest of the display remains empty. I use an ESP32 processor and the Platformio IDE. The wiring must be ok otherwise the display would not respond.
With this platformio file
[env:esp32doit-devkit-v1]
platform = espressif32
;platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.5 ;***
board = esp32doit-devkit-v1
framework = arduino
;board_build.filesystem = littlefs
monitor_speed = 115200
upload_speed = 512000
build_flags =
-D USER_SETUP_LOADED
;-D ILI9488_DRIVER ;320x480 invertDisplay(1) color ok
-D ILI9341_DRIVER ;240x320 invertDisplay(0); color red/blue changed
;-D ILI9486_DRIVER ;320x480 invertDisplay(0) color ok
;-D ILI9481_DRIVER ;320x240 white screen
;-D ST7789_DRIVER
;-D ST7789_2_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 TOUCH_CS=22
-D LOAD_FONT2
-D LOAD_FONT4
-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
lorol/LittleFS_esp32@^1.0.6
I've tried many setups and haven't had any success with any of them.
Now I'm stuck and hope one of you can help me
Thank you
Beta Was this translation helpful? Give feedback.
All reactions