Skip to content

How to use not the defaults for SDA and SCL for I2C #2045

Description

@barnycloud

I must use other pins for SDA and SCL (SDA= D3 / pin 0 and SCL D4/ pin 2) using I2C in my esp8266. The (no-name) OLED-display has a SH1006 controller. The following constructors do not work,, i.e. the display remains dark:
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, /* clock=/ SCL, / data=/ SDA);
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /
reset=/ U8X8_PIN_NONE, / clock=/ SCL, / data=*/ SDA);
SDA and SCL are defined as follows in the Arduino-IDE (used as editor) code:
#define SDA 0 // Pin 0 = D3
#define SCL 2 // // Pin 2 = D4
What went wrong? Any help appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions