0.91 inch Blue OLED Display Module Documentation
The 0.91 inch Blue OLED Display Module is a compact and high-contrast display solution for IoT projects. It features a 0.91 inch OLED screen with a resolution of 128x32 pixels, making it ideal for displaying text, icons, and simple graphics. This module is compatible with 3.3V and 5V microcontrollers and is suitable for a wide range of applications, including wearables, robots, and industrial automation systems.
The module has a 7-pin interface:
| Pin # | Function |
| --- | --- |
| 1 | VCC (3.3V or 5V) |
| 2 | GND |
| 3 | SCL ( Clock ) |
| 4 | SDA ( Data ) |
| 5 | RST ( Reset ) |
| 6 | D/C ( Data/Command ) |
| 7 | CS ( Chip Select ) |
The module communicates using the I2C protocol.
The following example demonstrates how to use the 0.91 inch Blue OLED Display Module with an Arduino board:
```cpp
#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Initialize with I2C address 0x3C
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Hello, World!");
display.display();
}
void loop() {
display.setCursor(0, 20);
display.println("Count: " + String(millis() / 1000));
display.display();
delay(1000);
}
```
Example Code: Raspberry Pi (Python)
The following example demonstrates how to use the 0.91 inch Blue OLED Display Module with a Raspberry Pi:
```python
import Adafruit_SSD1306
import time
disp = Adafruit_SSD1306.SSD1306_128_32(rst=None, i2c=1)
disp.begin()
disp.clear()
disp.set_text('Hello, World!', 0, 0, 2)
disp.display()
while True:
disp.set_text('Count: ' + str(int(time.time())), 0, 20, 2)
disp.display()
time.sleep(1)
```
Example Code: ESP32 (MicroPython)
The following example demonstrates how to use the 0.91 inch Blue OLED Display Module with an ESP32 board:
```python
import machine
import ssd1306
i2c = machine.I2C(scl=machine.Pin(22), sda=machine.Pin(21))
disp = ssd1306.SSD1306_I2C(128, 32, i2c)
disp.init_display()
disp.fill(0)
disp.text("Hello, World!", 0, 0, 1)
disp.show()
while True:
disp.fill(0)
disp.text("Count: " + str(time.time()), 0, 20, 1)
disp.show()
time.sleep(1)
```
Resources
Datasheet: [0.91 inch Blue OLED Display Module Datasheet](https://example.com/datasheet.pdf)
Library: [Adafruit SSD1306 Library](https://github.com/adafruit/Adafruit_SSD1306)
Note: The above code examples are for illustration purposes only and may require modifications to fit specific use cases.