Example run on XIAO BLE Sense/Expansion board (Arduino Framework) to control SSD1306 I2C OLED
Refer to document
Seeeduino XIAO Expansion board > OLED Display:
- u8g2 library is suggested
- a example is provided to control
the on-Expansion board SSD1306 I2C OLED
To make it work on XIAO BLE
Sense/Expansion board (Arduino Framework), change the code as
below, using U8X8_SSD1306_128X64_NONAME_HW_I2C instead of
U8X8_SSD1306_128X64_NONAME_SW_I2C.
XIAOBLE_OLED.ino
#include <Arduino.h>
#include <U8x8lib.h>
#include <Wire.h>
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
void setup(void) {
u8x8.begin();
u8x8.setFlipMode(1); //rotary 180
}
void loop(void) {
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 0);
u8x8.print("Hello World!");
}
Connection of OLED on Seeeduino XIAO Expansion board
According to Seeeduino XIAO Expansion board_v1.0_SCH_200824, OLED SCL and SDA is connected to XIAO D5 and D4.
No comments:
Post a Comment