The OLED 128x64 I2C Monochrome Display is a compact and versatile display module that offers high contrast and sharp images with its 128x64 pixel resolution. Utilizing Organic Light Emitting Diode (OLED) technology, this display can produce deep blacks and high brightness levels, making it suitable for a wide range of applications. Its I2C interface simplifies connectivity, requiring fewer pins and easing the communication process with microcontrollers like the Arduino UNO.
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VDD | Power supply (3.3V to 5V) |
3 | SCK | I2C Clock Line |
4 | SDA | I2C Data Line |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// OLED display TWI address
#define OLED_ADDR 0x3C
// Reset pin not used on 4-pin OLED module
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void setup() {
// Initialize with the I2C addr 0x3C (for the 128x64)
if(!display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) {
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, WHITE);
// Display the drawing
display.display();
}
void loop() {
// Nothing here for now
}
Q: Can I use this display with a 5V Arduino? A: Yes, the display can be powered with 5V, and it is compatible with 5V logic levels.
Q: How do I change the I2C address? A: The I2C address is typically fixed for these modules. If you need to use multiple displays, look for versions with configurable addresses or use an I2C multiplexer.
Q: Can the display show graphics and text? A: Yes, the display can show both graphics and text. The Adafruit GFX library provides functions for drawing shapes and text.
Q: Is it possible to use this display with other microcontrollers? A: Absolutely, as long as the microcontroller supports I2C communication and you have the appropriate library for the display controller.