olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
4.91k stars 1.02k forks source link

RaspPi Pico/Arduino IDE: Can't get the library to use other Clock and Data Pins. #2420

Closed theghostglitch closed 2 months ago

theghostglitch commented 2 months ago

My SSD1306 seems very finicky. I can't get it to use any other driver then U8G2_SSD1306_128X64_NONAME_F_HW_I2C This driver seems to ignore any input for Clock and Data pins.

I've used this constructor U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 21, 20); but it defaults to pins 5 and 4. According to the Pico documentation, these sets of pins are on the same I2C controller as the defaults so this should work. Am I missing something?

olikraus commented 2 months ago

Use "U8G2_SSD1306_128X64_NONAME_F_SW_I2C"

egnor commented 2 months ago

See https://github.com/olikraus/u8g2/issues/2289 (same issue?). (Software I2C is slowwwww!)

olikraus commented 2 months ago

The pin renaming feature as used in the initial post here, is only available for ESP systems. U8g2 simply does not know the SCL / SDA pins and assigning any other values is a non-standard Arduino extension. But I think the suggestion from @egnor should work.

theghostglitch commented 2 months ago

For some reason "U8G2_SSD1306_128X64_NONAME_F_SW_I2C" doesn't work at all on this display? No clue why. But yes, @egnor 's solution works. Thanks.