-
Notifications
You must be signed in to change notification settings - Fork 963
Description
file with the issue : lines 109, 130
In both the send command and send buffer methods the call to the i2c library looks like this
i2c_write_blocking(i2c_default, (SSD1306_I2C_ADDR & SSD1306_WRITE_MODE), buf, 2, false);
this issue is with the address parameter, (SSD1306_I2C_ADDR & SSD1306_WRITE_MODE), it should be just SSD1306_I2C_ADDR because the anding of SSD1306_WRITE_MODE which is 0xFE only works for some people using this example if their device address matches the 0x3C that is defaulted here. This is because that & FE is a no-op for addresses that are even, where as in my case the device address is 0x3D results in changing the address sent to 0x3C.
Another illustration for why that shouldn't be there is that if you were to change it to & SSD1306_READ_MODE it would be a no-op for all addresses and the example would still work.
My guess is this is a vestige from using a different i2c library that did not have both read and write methods but just send, even then the & doesn't seem like the right operator.
I can file a PR for this simple change or someone else can. I just hope it saves someone else the time i spent figuring out why my sparkfun made ssd1306 based Oled display with address 0x3D wouldn't do anything at all when running this example.