I2C with u8g2 lib not working for 0.5 Inch OLED display Arduino shields.

Hi,



I have one of your 0.5 Inch OLED display Arduino shields.

Unfortunately I do not get it to work in I2C mode (resistors changed accordingly…) together with the U8G2 lib on my Arduino Micro and Arduino MicroPro. (I used HW pins 2 and 3 for I2C connection)



SPI Mode works perfectly with the display and u8g2 lib…



Can you please advice or provide a sample code and wirering schematic please to use the u8g2 lib.

Thank you



Best regrads



Eike



My code look slike this:

note: none of the constructors works for I2C…



#include <U8g2lib.h>





//U8G2_LD7032_60X32_F_4W_SW_SPI u8g2(/rotation/U8G2_R0, /* clock=/ 3, / data=/ 2, / cs=/ 7, / dc(A0)=/ 6, / reset=/ 8);

//U8G2_LD7032_60X32_F_2ND_4W_HW_SPI u8g2(/rotation/U8G2_R0,/
cs=/ 7,/ dc=/ 6,/ reset=/ 8);





//U8G2_LD7032_60X32_F_SW_I2C u8g2(/rotation/U8G2_R0,/
clock=/ 3,/ data=/ 2); //, /reset=/ 8)

//U8G2_LD7032_60X32_F_HW_I2C u8g2(/rotation/U8G2_R0);

U8G2_LD7032_60X32_F_HW_I2C u8g2(/rotation/U8G2_R0, /reset=/ 8);//,/
clock=/ 3,/ data=*/ 2);



void setup(void) {

u8g2.begin();

}



void loop(void) {

u8g2.clearBuffer(); //lösche bildschirm puffer

u8g2.sendBuffer();

u8g2.setFont(u8g2_font_profont10_tf);

u8g2.drawStr(0,20,“Hello World!”);

u8g2.sendBuffer();

delay(200);

}

Basically it should work. Can you post a picture of your setup?



Oliver

Same question here: https://github.com/olikraus/u8g2/issues/865