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:
Download this tiger bitmap and save it to the microSD card! (Image by Shane Gorski)
Copy tiger.bmp into the base directory of a microSD card and insert it into the microSD socket on the underside of the shield.
Now start up the IDE and open the File→examples→Adafruit ImageReader Library→ShieldILI9341 example.
In the example, find the following section of code:
// Load full-screen BMP file 'purple.bmp' at position (0,0) (top left). // Notice the 'reader' object performs this, with 'tft' as an argument. Serial.print(F("Loading purple.bmp to screen...")); stat = reader.drawBMP("/purple.bmp", tft, 0, 0); reader.printStatus(stat); // How'd we do?
On the line with reader.drawBMP()
change "/purple.bmp"
to "/tiger.bmp"
.
After that, upload it to your Arduino. When the Arduino restarts, you should see the tiger appear as below!
Page last edited March 08, 2024
Text editor powered by tinymce.