Page 1 of 1

Unable to use U8G2 for ssd1306 display

Posted: 26 Mar 2024 00:42
by niom
Hi guys,

Have been trying to use ZUNO_U8G2 library.
Except I can't use classes defined there becuase they are guarded by the "U8X8_USE_PINS" guards. Is it done on pupose and am I missing something.
The sketch is pretty simple

Code: Select all

 U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2 (U8G2_R0, 255,10, 9);

void setup() {

  u8g2.begin();
  u8g2.setPowerSave(0);
  //modele d'écriture
  u8g2.setFont(u8g2_font_ncenB14_tr);
}

void loop() {

  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_ncenB14_tr);
  u8g2.drawStr(0, 20, "Hello World!");

  u8g2.sendBuffer();
}

Would you mind telling me what am I doing wrong?

Re: Unable to use U8G2 for ssd1306 display

Posted: 27 Mar 2024 10:25
by niom
Switched to Arduino IDE and everything compiled fine. I guess it's my VS Code environment that messes something up.
My bad.