The Adafruit 1.27 inch 16-bit Color OLED with microSD holder is a compact and vibrant display module suitable for adding visual output to your electronics projects. With its high contrast ratio and 16-bit color depth, it can display rich, colorful graphics and text. This OLED is perfect for wearable devices, small instruments, or any application where space is at a premium and a high-quality display is required. The built-in microSD card holder adds the convenience of storing images and fonts, making it ideal for dynamic content display.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | SPI Clock |
4 | SDA | SPI Data |
5 | RES | Reset pin |
6 | DC | Data/Command control pin |
7 | CS | SPI Chip Select |
8 | SD_CS | microSD Card Chip Select |
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
// Pin definitions
#define OLED_CS 10 // Chip select for the OLED display
#define OLED_DC 9 // Data/command for the OLED display
#define OLED_MOSI 11 // MOSI for the OLED display (connect to SDA)
#define OLED_CLK 13 // Clock for the OLED display (connect to SCL)
#define OLED_RESET 8 // Reset for the OLED display
#define SD_CS 4 // Chip select for the microSD card
// Create an Adafruit_SSD1351 object
Adafruit_SSD1351 oled = Adafruit_SSD1351(OLED_CS, OLED_DC, OLED_MOSI, OLED_CLK, OLED_RESET);
void setup() {
// Initialize the display
oled.begin();
// Fill the screen with black
oled.fillScreen(SSD1351_BLACK);
// Set text color to white
oled.setTextColor(SSD1351_WHITE);
// Set the cursor to top-left corner
oled.setCursor(0, 0);
// Display some text
oled.println("Hello, World!");
}
void loop() {
// Main loop does nothing, text is displayed on the screen
}
Q: Can I use this display with a 5V microcontroller? A: Yes, the display is 5V tolerant, but it is recommended to use a level shifter for SPI lines.
Q: What library should I use for this display? A: The Adafruit_SSD1351 library is recommended for this OLED display.
Q: How do I store images on the microSD card for display? A: Images should be stored in a format that your code can read (e.g., BMP) and the file system should be compatible with your microcontroller's SD card library.
Q: Can I use this display in outdoor environments? A: OLED displays are generally not suitable for direct sunlight as they can be difficult to read. Additionally, extreme temperatures or humidity can damage the display.