Break from while loops after specific time

very compact description of the basic principle

If the i2c-device does not answer the i2c-routine will hang. i2c-communication is blocking. If this device is a professional build device or a professional build i2c-chip its i2c-bus will work very reliable. If it is something hand-coded for communication between two microcontrollers I would change this communication to serial, because serial can be configured with timeouts.

best regards Stefan