but as soon as I request values from a sensor on the same I2C bus the screen freezes. The sketch carries on as I get serial output.
I've tried the other constructors with no output (including HW), tried defining the address as another suggested (u8g2.setI2CAddress(0x78);//I2C address multiplied with 2 (the lowest bit must be zero)) but still nothing.
Its doubling frustrating as I had it working on a U8 library and can't get that going now either!
First check, whether your display works with U8g2 HW I2C (without any other I2C device on the bus). If the OLED does NOT work with the u8g2 hardware constructor, then (as David mentioned) the OLED is broken and does not support Hardware I2C.
In such a case you can not use the two devices on the same bus. However, you could use any other pair of pins for the SW I2C for the display.
If your display works as with HW I2C, then there should be a good chance that the OLED works together with any other I2C devices on the bus. The only other problem might be, that the library/code for the other I2C does not use the more modern "beginTransmission/endTransmission" commands of the Arduino IDE.
Thanks for the pointers both. I had seen that post but didn't understand the implication. After testing it seems I have a non-acknowledging part as it only works with SW I2C, which is a bit frustrating, so I'll try creating a SW bus for the screen and put the sensors on the hardware bus.
This worked for me very well! Thanks a lot!!
Is there a reason why this workaround needs to be used with the u8g2 library? After all the i2c display I am using should work with all the other i2c sensors in perfect harmony right?