ILI9341 display white screen

Hello everyone, I recently purchased an ili9341 2.8 inch display from amazon ili9341 to test my Arduino nano rp2040. images of my wiring are shown below:


IMG_0693

Running the Adafruit ili9341 graphic test example seems to work and display great, but when I tried to create a simple code, the display would compile and upload, but the screen would remain white. the code I created is below:


As I am relatively new to Arduino so I am not too sure why this problem is occurring. If anyone has any tips that may help that would be much appreciated :slight_smile:
Regards, Ethan

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Ah, my bad sorry. This is the code I tried to use:

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

#define TFT_CS         13
#define TFT_DC         12
#define TFT_LED        24
#define TFT_RST        11
#define TFT_COPI       14
#define TFT_SCK        16
#define TFT_CIPO       15

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_COPI, TFT_SCK, TFT_RST, TFT_CIPO);

void setup() {
  
  Serial.begin(9600);

  
  // put your setup code here, to run once:
  pinMode(TFT_LED, OUTPUT);
  digitalWrite(TFT_LED, HIGH);
  tft.begin();
  tft.setRotation(0);
  tft.fillScreen(tft.color565(255, 0, 255));
}

void loop() {
  // put your main code here, to run repeatedly:

}

Are you certain this is correct:

... maybe try this:

#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

#define TFT_DC 12
#define TFT_CS 13
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

Thank you for the reply. I have tried this and got the following error:

C:\Users\User\Pictures\diss work\examplesketch\examplesketch.ino: In function 'void setup()':
C:\Users\User\Pictures\diss work\examplesketch\examplesketch.ino:18:11: error: 'TFT_LED' was not declared in this scope
   pinMode(TFT_LED, OUTPUT);
           ^~~~~~~
C:\Users\User\Pictures\diss work\examplesketch\examplesketch.ino:18:11: note: suggested alternative: 'TFT_CS'
   pinMode(TFT_LED, OUTPUT);
           ^~~~~~~
           TFT_CS

I tried doing what it suggested and declared only cs, dc and led pin so it looked like this:

#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>

#define TFT_CS         13
#define TFT_DC         12
#define TFT_LED        24




Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_LED);

And kept the setup the same.
The screen is still white. I'm not sure if I need the LED pin connected to an output pin on the Arduino, or to the VCC pin which itself is connected to the 3.3v pin.
Any more help would be greatly appreciated.

Read post #4.

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