There is a built in microSD card slot into the breakout, and we can use that to load bitmap images! You will need a microSD card formatted FAT16 or FAT32 (they almost always are by default).
It's really easy to draw bitmaps. We have a library for it, Adafruit_ImageReader, which can be installed through the Arduino Library Manager (Sketch→Include Library→Manage Libraries…). Enter “imageread” in the search field and the library is easy to spot:
Lets start by downloading this image of pretty flowers (pix by johngineer)
Copy purple.bmp into the base directory of a microSD card and insert it into the microSD socket in the breakout.
You'll need to connect up the SDCS pin to Digital 4 on your Arduino, and the MISO to MISO (or Digital #12 on an Uno) as well. In the below image, those are the extra purple & light blue wires
You may want to try the SD library examples before continuing, especially one that lists all the files on the SD card
Now upload the File→examples→Adafruit ImageReader Library→ShieldILI9341 example to your Arduino + breakout. You will see the flowers appear!
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. You can rotate images using the setRotation() procedure
You can draw as many images as you want - dont forget the names must be less than 8 characters long. Just copy the BMP drawing routines below loop() and call
bmpDraw(bmpfilename, x, y);
For each bitmap. They can be smaller than 320x240 and placed in any location on the screen.
Page last edited March 08, 2024
Text editor powered by tinymce.