I have run into a ‘hang’ problem using the Wire.h library with a Mega acting as an I2C Master talking to a UNO I2C Slave.
All works fine UNLESS the UNO is unpowered. I was looking for some kind of error checking that would tell me the Slave was not there.
I tried the conventional I2C address scanning code, and it too hung when the UNO was unpowered. (When powered all was fine and the slave address was found).
Is this somehow due to the unpowered UNO effecting the SCL/SDA lines? I know the Mega has pullups on those lines but I tried to add external 5K pullups - no difference.