Just receive my brand new XIAO ESP32C3 as well as the Seeed Studio Expansion Base (the one with the OLED display), plus a few grove accessories.
If everything seems to work well, I have an issue. Impossible to make the OLED display working.
I downloaded the library (U8g2) as mentionned in the WiKi aboute the expansion base, I copied the code from the WikI, it compile, it download but the display continue to be completlly blank.
I could make the BME280 sensor work well and display the values on the Serial Monitor but impossible to use the OLED on the Expansion Base.
The OLED display is part of the board, nothing (apparently) to configure.
Here is the code I copied from the WiKi from Seeed Studio :
*#include <Arduino.h>*
*#include <U8x8lib.h>*
*#include <Wire.h>*
* *
*U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display*
* *
*void setup(void) {*
* u8x8.begin();*
* u8x8.setFlipMode(1); // set number from 1 to 3, the screen word will rotary 180*
*}*
* *
*void loop(void) {*
* u8x8.setFont(u8x8_font_chroma48medium8_r);*
* u8x8.setCursor(0, 0);*
* u8x8.print("Hello World!");*
*}*
And here is the error I get when I compile :
/tmp/.arduinoIDE-unsaved2023015-42259-ri52n4.ided/sketch_jan15a/sketch_jan15a.ino:5:52: error: 'PIN_WIRE_SCL' was not declared in this scope
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
^~~~~~~~~~~~
/tmp/.arduinoIDE-unsaved2023015-42259-ri52n4.ided/sketch_jan15a/sketch_jan15a.ino:5:52: note: suggested alternative: 'PIN_CTRL'
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
^~~~~~~~~~~~
PIN_CTRL
/tmp/.arduinoIDE-unsaved2023015-42259-ri52n4.ided/sketch_jan15a/sketch_jan15a.ino:5:77: error: 'PIN_WIRE_SDA' was not declared in this scope
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
^~~~~~~~~~~~
/tmp/.arduinoIDE-unsaved2023015-42259-ri52n4.ided/sketch_jan15a/sketch_jan15a.ino:5:77: note: suggested alternative: 'FUN_IE_S'
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/ PIN_WIRE_SCL, /* data=*/ PIN_WIRE_SDA, /* reset=*/ U8X8_PIN_NONE); // OLEDs without Reset of the Display
^~~~~~~~~~~~
FUN_IE_S
exit status 1
Compilation error: 'PIN_WIRE_SCL' was not declared in this scope
Compilation error: 'PIN_WIRE_SCL' was not declared in this scope
add a definition before the u8x8 declaration for the XIAO on Expansion board: #define PIN_WIRE_SCL D5 where D5 is the pin name for I2C SCL (clock) signal #define PIN_WIRE_SDA D4 where D4 is the pin name for I2C SDA (data) signal
note I do not have an ESP32 to actually try so the actual pin names be different for you.
Right, this might be strange, but the exact same code does nothing (nothing shows up on LCD) using my Windows Arduino. However, I changed to my Mac, and it works! I suspect there is something wrong with my windows library. Try using another computer (doesn’t matter windows or mac)
one thing you can try is connect one expansion board to another expansion board via the IIC cable…
if the display on the expansion board is working… both displays will show identical images