There is a built in microSD card slot into the shield, 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).
The SD card socket shares pins with the TFT, so many of the 'default' example sketches for the SD card will not work without following the initialization steps in this sketch. Before assuming that the TFT shield is broken because the default SD examples wont work, run this BMP drawing sketch. If you need to use the microSD card holder look carefully at the example sketch to see the steps to initialize the card and TFT in order.
You'll also need to download our SD library modifyied to allow faster reads (these changes will be added to arduino v23) but for now you can download the new library here
. Download the library by clicking the Downloads
button and uncompressing the folder. Replace the files in your ArduinoIDE/libraries/SD
folder and restart the IDE.FOR MEGA ARDUINOS
edit the SD/utility/Sd2Card.h
file after installing and uncomment the line that says #define MEGA_SOFT_SPI 1
to allow the Mega to use the same pinout for SD cards as the Classic Arduinos.Download this tiger bitmap and save it to the microsd card
! (Image by Shane Gorski)
Start up the IDE and select the tftbmp_shield
sketch. Upload it to your Arduino to see the tiger!
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.