Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The "other" device will never recognize the I2C address, so it will ignore the data and simply not respond. .... Think of it as a "Chip Enable" as mentioned earlier in this thread.... only you acomplish it by swapping the SDA and SCL on just one of the I2C devices in this case.If the data line goes low without the clock line then all devices see a start condition. Can't work out if that would be a problem.
Mike.
The Wire.write() command needs data type BYTE. In the code, the variable "value" is an int.
Looks like software I2C for the OLED will be the way to go. I will try this out today hopefully.
Regarding the cheap OLED: Where can I find good ones? (UK supplier preferably) There's so many on sale but they all look to be basically the same.
And now it works!
Thank you all so much for your help. It is greatly appriciated!
The solution in the end is simpler than I had even hoped, and I have learned lots of useful thins along the way. Thank you again everyone.
For any googlers turning up here looking why the SH1106 OLED etc or ug8lib wont work with their other I2C devices the solution is.
Don't trust the spec the Chinese give you. Scan for the address. Read the bit in the u8g2 library that says the byte supplied for address must be the address multiplied by 2. Not sure why they don't just multiply by 2 in the library so you can pass the actual address, but oh well, it works.
They all come from China anyway, if you can find a UK supplier they will simply be buying them from China and applying a decent profit margin for themselves - so same item, much higher price, but faster delivery.
Looking at the MCP datasheet, I can't find any reference to the I2C address. Am I going blind or is that considered superfluous information these days?
Mike.
So, why doesn't the I2C scanner find the LCD at 0x78?
Mike.
We all should. Having mainly used pics in the past where the unshifted address is used, it never occurred to me that the Arduino uses shifted addresses (sometimes).And BTW, I should have seen that problem way sooner...