I tried to use the 128X64 OLED by using U8g2Lib's software I2C , but it doesn't work.
However, I used the same code on Arduino UNO,and it worked well (except pins definations).
My chip is STM32F103ZET6
SDA => PF8
SCL => PF10
Please recommand me a usable lib if this actually a bug.
Below is my code.
Thank you

Code: Select all
#include <U8g2lib.h>
#include <Wire.h>
#define SCL_OLED PF10
#define SDA_OLED PF8
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /*clock=*/SCL_OLED, /*data=*/SDA_OLED, /*reset=*/U8X8_PIN_NONE);
void setup() {
pinMode(SDA_OLED, OUTPUT);
pinMode(SCL_OLED, OUTPUT);
u8g2.begin();
u8g2.enableUTF8Print(); // enable UTF8 support for the Arduino print() function
}
void loop() {
u8g2.setFont(u8g2_font_unifont_t_symbols);
u8g2.firstPage();
do
{
u8g2.setCursor(0, 15);
u8g2.print("Hello World!");
} while (u8g2.nextPage());
delay(1000);
}