TeensyWolf
Well-known member
I goofed on my PCB, using SDA1/SCL1 instead of SDA/SCL, but having trouble getting it to work with hardware i2c, when using 2ND_HW_I2C. I tried the HW_I2C also.
The following only works in SW_I2C
I tried same thing with the u8g2
What can I do to get hardware i2c working here?
The following only works in SW_I2C
Code:
#include <Arduino.h>
#include <U8x8lib.h>
//U8X8_SSD1306_128X64_NONAME_2ND_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // does not work
//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); // for primary
U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(16, 17, U8X8_PIN_NONE); // for T4 2nd I2C, this works
void setup() {
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFont(u8x8_font_courB18_2x3_f);
u8x8.setCursor(0,0);
u8x8.println("hi world");
}
I tried same thing with the u8g2
Code:
#include <Arduino.h>
#include <U8g2lib.h>
// Graphics U8G2
//U8G2_SSD1306_128X64_NONAME_1_2ND_HW_I2C u8g2( U8G2_R0, U8X8_PIN_NONE ); //[page buffer, size = 128 bytes] - not working
U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2( U8G2_R0, 16 , 17 , U8X8_PIN_NONE ); // [page buffer, size = 128 bytes] working
void setup() {
u8g2.begin();
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_ncenB08_tr);
u8g2.drawStr(1,8,"Hello World!");
u8g2.sendBuffer();
}
What can I do to get hardware i2c working here?