An Organic Light Emitting Diode (OLED) is a type of display technology that uses organic compounds to emit light when an electric current is applied. It is known for its high contrast ratios, deep blacks, and wide viewing angles. OLED displays are commonly used in various applications, including:
Parameter | Value |
---|---|
Display Type | OLED |
Resolution | 128x64 pixels |
Interface | I2C / SPI |
Operating Voltage | 3.3V - 5V |
Current Consumption | 20mA (typical) |
Viewing Angle | >160 degrees |
Operating Temperature | -40°C to 85°C |
Dimensions | 27.0mm x 27.0mm x 4.1mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power Supply (3.3V - 5V) |
3 | SCL | Serial Clock Line |
4 | SDA | Serial Data Line |
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground |
2 | VCC | Power Supply (3.3V - 5V) |
3 | SCK | Serial Clock |
4 | MOSI | Master Out Slave In |
5 | RES | Reset |
6 | DC | Data/Command |
7 | CS | Chip Select |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Define the OLED reset pin
#define OLED_RESET -1
// Create an instance of the SSD1306 display
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
// Initialize the display
if(!display.begin(SSD1306_I2C_ADDRESS, OLED_RESET)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
display.clearDisplay();
// Display text
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.println(F("Hello, world!"));
display.display();
}
void loop() {
// Add your main code here, to run repeatedly
}
Display Not Turning On
Garbled or Noisy Display
Partial Display or Missing Pixels
By following this documentation, users should be able to effectively integrate and utilize the OLED display module in their projects, whether they are beginners or experienced electronics enthusiasts.