The SparkFun Micro OLED Breakout is a compact and versatile display module that provides a high-contrast, high-resolution OLED display for a variety of electronics projects. With its 64x48 pixel resolution, this module is perfect for displaying text, graphics, and animations. Common applications include wearable devices, status indicators, user interfaces, and any project where visual feedback is beneficial.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V - 5V) |
3 | D0 | Clock for SPI / I2C serial clock (SCL) |
4 | D1 | Data for SPI / I2C serial data (SDA) |
5 | RES | Reset pin |
6 | DC | Data/Command control pin (SPI mode only) |
7 | CS | Chip Select (SPI mode only) |
To use the SparkFun Micro OLED Breakout in your project, follow these steps:
Here is a sample code snippet for initializing and displaying text on the Micro OLED using an Arduino UNO with I2C communication:
#include <Wire.h>
#include <SFE_MicroOLED.h> // Include the SFE_MicroOLED library
#define PIN_RESET 9 // Connect RST to pin 9 (modifiable)
#define PIN_DC 8 // Connect DC to pin 8 (modifiable, only for SPI)
#define PIN_CS 10 // Connect CS to pin 10 (modifiable, only for SPI)
// Declare a MicroOLED object. The parameters include:
// 1. The reset pin
// 2. The DC pin (only for SPI)
// 3. The CS pin (only for SPI)
MicroOLED oled(PIN_RESET, PIN_DC, PIN_CS);
void setup() {
oled.begin(); // Initialize the OLED
oled.clear(ALL); // Clear the display's internal memory
oled.display(); // Display what's in the buffer (splashscreen)
delay(1000); // Delay 1000 ms
oled.clear(PAGE); // Clear the buffer.
}
void loop() {
oled.setFontType(0); // Set font to type 0
oled.setCursor(0, 0); // Set cursor to top-left
oled.print("Hello, OLED!"); // Print "Hello, OLED!"
oled.display(); // Display what's in the buffer
delay(1000); // Delay 1000 ms
}
Ensure you have installed the SFE_MicroOLED
library in the Arduino IDE before uploading this code to your Arduino UNO.
Q: Can the Micro OLED Breakout be used with 5V systems? A: Yes, the module can be directly connected to a 5V power supply.
Q: How do I control the brightness of the display? A: Brightness (contrast) can be controlled through software using the library's functions.
Q: Is the display readable in direct sunlight? A: OLED displays are typically not as visible in direct sunlight as backlit LCDs. It is best to use this display in shaded or indoor environments.
For further assistance, consult the SparkFun Micro OLED Breakout forums and the community for additional support and resources.