Datasheet

rotate images using the setRotation() procedure.
The BreakoutSSD1351 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:
You can draw as many images as you want — though remember the names must be less than 8 characters long. Call
like so:
'x' and 'y' are pixel coordinates where top-left corner of the image will be placed. Images can be placed anywhere on
screen…even partially off screen, the library will clip the section to load.
Image loading is explained in greater depth in the Adafruit_GFX library guide. (https://adafru.it/DpM)
#include <SPI.h>
#include <SD.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_SSD1351.h> // Hardware-specific library
#include <Adafruit_ImageReader.h> // Image-reading functions
#define SD_CS 7 // SD card select pin
#define TFT_CS 5 // TFT select pin
#define TFT_DC 4 // TFT display/command pin
#define TFT_RST 6 // Or set to -1 and connect to Arduino RESET pin
Adafruit_SSD1351 tft = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, TFT_CS, TFT_DC, TFT_RST);
Adafruit_ImageReader reader; // Class w/image-reading functions
ImageReturnCode stat; // Status from image-reading functions
stat = reader.drawBMP("/lily128.bmp", tft, 0, 0);
reader.drawBMP(filename, tft, x, y);
© Adafruit Industries https://learn.adafruit.com/adafruit-1-5-color-oled-breakout-board Page 17 of 18