TFT_eSPI and ILI9488 - nothing happens

Hello,

I am testing a TFT display (ILI9488) with an ESP wroom 32.

This is the wiring:

And here the coding:

#include <Arduino.h>     // Hardware-specific library
#include <SPI.h>     // Hardware-specific library

#include <TFT_eSPI.h>     // Hardware-specific library
#include <TFT_eWidget.h>  // Widget library

#include <Setup21_ILI9488.h>

TFT_eSPI tft  = TFT_eSPI();      // Invoke custom library

MeterWidget   amps  = MeterWidget(&tft);
MeterWidget   volts = MeterWidget(&tft);
MeterWidget   ohms  = MeterWidget(&tft);

#define LOOP_PERIOD 35 // Display updates every 35 ms

float mapValue(float ip, float ipmin, float ipmax, float tomin, float tomax)
{
  return tomin + (((tomax - tomin) * (ip - ipmin))/ (ipmax - ipmin));
}
void setup(void) 
{
  tft.init();
  tft.setRotation(0);
  tft.fillScreen(TFT_BLACK);
  Serial.begin(115200); // For debug
  
  
  // Colour zones are set as a start and end percentage of full scale (0-100)
  // If start and end of a colour zone are the same then that colour is not used
  //            --Red--  -Org-   -Yell-  -Grn-
  amps.setZones(75, 100, 50, 75, 25, 50, 0, 25); // Example here red starts at 75% and ends at 100% of full scale
  // Meter is 239 pixels wide and 126 pixels high
  amps.analogMeter(0, 0, 2.0, "mA", "0", "0.5", "1.0", "1.5", "2.0");    // Draw analogue meter at 0, 0

  // Colour draw order is red, orange, yellow, green. So red can be full scale with green drawn
  // last on top to indicate a "safe" zone.
  //             -Red-   -Org-  -Yell-  -Grn-
  volts.setZones(0, 100, 25, 75, 0, 0, 40, 60);
  volts.analogMeter(0, 128, 10.0, "V", "0", "2.5", "5", "7.5", "10"); // Draw analogue meter at 0, 128

  // No coloured zones if not defined
  ohms.analogMeter(0, 256, 100, "R", "0", "", "50", "", "100"); // Draw analogue meter at 0, 128
}


void loop() 
{
  static int d = 0;
  static uint32_t updateTime = 0;  

  if (millis() - updateTime >= LOOP_PERIOD) 
  {
    updateTime = millis();

    d += 4; if (d > 360) d = 0;

    // Create a Sine wave for testing, value is in range 0 - 100
    float value = 50.0 + 50.0 * sin((d + 0) * 0.0174532925);

    float current;
    current = mapValue(value, (float)0.0, (float)100.0, (float)0.0, (float)2.0);
    //Serial.print("I = "); Serial.print(current);
    amps.updateNeedle(current, 0);

    float voltage;
    voltage = mapValue(value, (float)0.0, (float)100.0, (float)0.0, (float)10.0);
    //Serial.print(", V = "); Serial.println(voltage);
    volts.updateNeedle(voltage, 0);
    
    float resistance;
    resistance = mapValue(value, (float)0.0, (float)100.0, (float)0.0, (float)100.0);
    //Serial.print(", R = "); Serial.println(resistance);
    ohms.updateNeedle(resistance, 0);
  }
}

I am using platformio with the following ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp_wroom_02]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps = 
	bodmer/TFT_eSPI@^2.5.22
	bodmer/TFT_eWidget@^0.0.6

I copied the Setup21_ILI9488.h into my folder.
It is compiling and uploading, but nothing else happens :frowning:

Does anybody have an idea what I am missing?

Thanks in advance,
Roger

the contents of this file must be placed (with replacement) in the file TFT_eSPI/User_Setup.h

I have read similar statements, but I am not really sure what does that mean - sorry.
In the lib is a file User_Setup.h (folder libdeps/TFT_eSPI).
There is #define ILI9341_DRIVER not commented.
What do I need to do when your write: "must be placed (with replacement) in the file TFT_eSPI/User_Setup.h"

I deleted the content of TFT_eSPI/User_Setup.h. Then I copied the content of Setup21_ILI9488.h in the empty TFT_eSPI/User_Setup.h file.

But no change...

add in User_Setup.h files

#define USER_SETUP_INFO "User_Setup"

and delete

#define USER_SETUP_ID 21

I have now tested in User_Setup_Select.h under the line "// Only ONE line below should be uncommented..." and tried exactly that to uncomment only one line.

Here I had tested now:

  • #include <User_Setups/Setup16_ILI9488_Parallel.h> => White screen! But should be red (I only heve fillScreen(TFT_RED) now in main
  • #include <User_Setups/Setup20_ILI9488.h> => nothing happens
  • #include <User_Setups/Setup21_ILI9488.h> => nothing happens

post a picture of the display from the back

My reduced main is now:

#include <Arduino.h>     // Hardware-specific library
#include <SPI.h>     // Hardware-specific library

#include <TFT_eSPI.h>     // Hardware-specific library

TFT_eSPI tft  = TFT_eSPI();      // Invoke custom library

void setup(void) 
{
  tft.init();
  tft.setRotation(0);
  tft.fillScreen(TFT_RED);
  Serial.begin(115200); // For debug
}

void loop() {}

#include <User_Setups/Setup204_ESP32_TouchDown.h>

That did the trick...
The displays shows a red background now :slight_smile:

so did you understand why it didn't work?

#define TOUCH_CS 21

Yes... there was a warning, but no error.
So I thought at least display should work, but no touch.

But thanks for your support!

Devices use the same SPI lines, if these lines were not connected to TOUCH, then the display would work ... recently V2.0 displays began to come across in which there was a completely different controller, ILI9341 was expected to be ST7789, but the IPS matrix

And how can I recognize the controller of my display?
I bought this one: https://www.amazon.de/dp/B08GBYQQV5?psc=1&ref=ppx_yo2ov_dt_b_product_details
ILI9488 is mentioned

try to ask the seller, there is such an opportunity

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.