Arduino Code

Once you have the display wired up, its time to test your wiring by uploading the example code we have written. Again, we suggest using an Arduino to test.

Install Library

Go to the Arduino Library manager under Sketch -> Include Library -> Manage Libraries...

From within the Library manager, start by installing Adafruit GFX:

Then look for and install the Adafruit ILI9341 library

Note that this display has an ILI9340 but we still use the ILI9341 library, it's OK! The chips are nearly identical

If using an older Arduino IDE (pre-1.8.10), also locate and install Adafruit_BusIO (newer versions do this one automatically).

Run Graphics Test

Restart the Arduino IDE. You should now be able to select File > Examples > Adafruit_ILI9341 > graphicstest sketch. Upload the sketch to your Arduino wired as before

Once uploaded, the Arduino should perform all the test display procedures! If you're not seeing anything - first check if you have the backlight on, if the backlight is not lit something is wrong with the power/backlight wiring. If the backlight is lit but you see nothing on the display make sure you're using our suggested wiring.

This guide was first published on Aug 29, 2012. It was last updated on Aug 29, 2012.
This page (Arduino Code) was last updated on Aug 11, 2020.