The Adafruit OLED Monochrome 1.3in 128x64 with STEMMA QT is a compact and versatile display module that offers high contrast and excellent readability under various lighting conditions. Its 128x64 pixel resolution provides sufficient detail for text and simple graphics, making it suitable for a wide range of applications, including wearable devices, portable instruments, and embedded systems. The inclusion of the STEMMA QT connector simplifies interfacing with other compatible devices, enabling quick prototyping and development.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power supply (3.3V - 5V) |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | RST | Reset pin (optional, can be left NC) |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SCL, SDA pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
void setup() {
// Initialize with the I2C addr 0x3C (for the 128x64)
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Clear the buffer
display.clearDisplay();
// Draw a single pixel in white
display.drawPixel(10, 10, SSD1306_WHITE);
// Display the drawing
display.display();
}
void loop() {
// Nothing to do here
}
Q: Can I use this display with a 5V microcontroller? A: Yes, but ensure that the I2C lines are level-shifted to be compatible with the display's logic level.
Q: How do I install the Adafruit SSD1306 library? A: You can install the library through the Arduino Library Manager by searching for "Adafruit SSD1306" and installing it.
Q: What is the STEMMA QT connector for? A: The STEMMA QT connector allows for easy plug-and-play connection with other STEMMA QT or Qwiic compatible devices without soldering.
Q: Can I display images on this OLED? A: Yes, you can display bitmap images, but they need to be converted to a monochrome format suitable for the display's resolution.
Q: How do I control the brightness of the display? A: The Adafruit SSD1306 library provides functions to adjust the contrast of the display, which can be used to control brightness.