The Adafruit OLED FeatherWing is an add-on board for the Adafruit Feather ecosystem, providing a compact and easy-to-read 128x32 pixel monochrome OLED display. This display is ideal for presenting data, menus, and other visual feedback in a clear and legible format. It is commonly used in wearable devices, portable instruments, and any application where a small display is necessary.
Pin | Description |
---|---|
GND | Ground connection |
3V | 3.3V power supply |
SCL | I2C clock line |
SDA | I2C data line |
RST | Reset pin (optional use) |
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Initialize with the I2C addr 0x3C (for the 128x32)
if(!display.begin(SSD1306_I2C_ADDRESS, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
display.clearDisplay();
// Draw a single pixel in white
display.drawPixel(10, 10, WHITE);
// Show the display buffer on the screen
display.display();
delay(2000); // Pause for 2 seconds
}
void loop() {
// Put your main code here, to run repeatedly:
}
Wire
library's begin()
function to specify the I2C address if it's different from the default.Q: Can I use the OLED FeatherWing with boards other than Adafruit Feather?
A: Yes, as long as the board supports 3.3V logic and has an I2C interface.
Q: How do I control the brightness of the display?
A: You can use the setContrast()
function provided by the Adafruit_SSD1306 library to adjust the brightness.
Q: Is it possible to display images on the OLED FeatherWing?
A: Yes, you can display bitmap images using the Adafruit_GFX library functions.
Q: Can I use multiple OLED FeatherWings together?
A: Yes, but you will need to manage different I2C addresses and ensure each display is addressed separately in your code.