The Adafruit OLED Color 0.96 inch 96x64 with microSD is a compact and vibrant display module suitable for adding visual output to your electronics projects. This OLED (Organic Light Emitting Diode) display boasts a 96x64 pixel resolution with full-color capabilities, making it ideal for displaying graphics, images, and custom user interfaces. The inclusion of a microSD card slot allows for expanded storage options, enabling the display of images and data files directly from a microSD card.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | Serial Clock Line (SPI/I2C clock) |
4 | SDA | Serial Data Line (SPI/I2C data) |
5 | RES | Reset pin |
6 | DC | Data/Command control pin (SPI mode only) |
7 | CS | Chip Select (SPI mode only) |
8 | SD_CS | microSD card Chip Select |
#include <Adafruit_GFX.h> // Include core graphics library for the display
#include <Adafruit_SSD1331.h> // Include the OLED driver library
// Pin definitions for the Arduino UNO
#define sclk 13
#define mosi 11
#define cs 10
#define rst 9
#define dc 8
// Create an Adafruit_SSD1331 object
Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, mosi, sclk, rst);
void setup() {
display.begin(); // Initialize the display
display.fillScreen(BLACK); // Clear the screen to black
}
void loop() {
// Example: Draw a red rectangle
display.drawRect(10, 10, 50, 40, RED);
delay(500);
// Example: Fill the rectangle with blue color
display.fillRect(10, 10, 50, 40, BLUE);
delay(500);
}
Note: This example assumes that the display is connected in SPI mode. Make sure to install the Adafruit GFX and SSD1331 libraries before uploading the code to your Arduino UNO.
Q: Can I power the display with 5V? A: Yes, the display can be powered with a 5V supply, but the logic level for data pins is 3.3V.
Q: How do I store images on the microSD card for the display? A: Images should be stored in a compatible format (e.g., BMP) and the card should be formatted to FAT16 or FAT32.
Q: Can I use this display with other microcontrollers besides Arduino UNO? A: Yes, the display can be used with any microcontroller that supports SPI or I2C communication, provided you adapt the pin connections and logic levels accordingly.