Datasheet
To make new bitmaps, make sure they are less than 240 by 320 pixels and save them in 24-bit BMP format! They
must be in 24-bit format, even if they are not 24-bit color as that is the easiest format for the Arduino to decode. You
can rotate images using the setRotation() procedure.
The ShieldILI9341 example sketch shows everything you need to work with BMP images. Here’s just the vital bits
broken out…
Several header files are included at the top of the sketch. All of these are required…they let us access the SD card and
the display, and provide the image-reading functions:
Several #defines relate to hardware pin numbers, all fixed values when using the shield.
Then we declare the tft screen object, and the image-reader object like so:
After the SD and TFT’s begin() functions have been called (see the example sketch again, in the setup() function), you
can then call reader.drawBMP() to load an image from the card to the screen:
#include <SPI.h>
#include <SD.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ILI9341.h> // Hardware-specific library
#include <Adafruit_ImageReader.h> // Image-reading functions
#define SD_CS 4 // SD card select pin
#define TFT_CS 10 // TFT select pin
#define TFT_DC 9 // TFT display/command pin
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
Adafruit_ImageReader reader; // Class w/image-reading functions
© Adafruit Industries https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2 Page 22 of 26