I am trying to use my new ILI9341 displays with my arduino mega, but when turned on, it only shows a white screen, even tho it work perfectly in the simulator.
The display im using has J1 OPEN, and when i searched i found that it means it should work fine with 5V.
Tryed with logic level convertors to but the same issue apears there asvell.
Here is the code im using
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#define TFT_CS 22
#define TFT_RST 23
#define TFT_DC 24
#define TFT_LED 25
#define TFT_MISO 50
#define TFT_MOSI 51
#define TFT_SCK 52
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCK, TFT_RST, TFT_MISO);
void setup() {
// put your setup code here, to run once:
pinMode(TFT_LED, OUTPUT);
digitalWrite(TFT_LED, HIGH);
tft.begin();
tft.setRotation(1);
tft.fillScreen(ILI9341_BLACK);
tft.drawCircle(50, 50, 40, ILI9341_WHITE);
}
void loop() {
// put your main code here, to run repeatedly:
}
The simulated screen does not match your actual screen.
On my ILI9341 (14 pin including touch) I have to pull the reset pin up to 5v with a 10k resistor.
If that does not help, show a schematic and a link to the vendor page where you purchased yours.
I have the 2.8" version of this screen. The connections look exactly the same.
If pin 23 (above) is the reset pin on the display, try adding this to setup(): pinMode(TFT_RST, INPUT_PULLUP) ;
If that does not work, try an external 10k resistor between the screen's reset pin and the screen's VCC pin