Is there a way to prevent a lockup in the event of an I2C sensor failure?

Greeting all.

I have a project that uses the Microchip TC74A0 I2C temperature sensor. Is there a good way to prevent a lockup in the event of sensor failure or a communication failure?

I would like to be able to handle the error.

I am using the Wire library.

Thank you.

You can test the return codes from the write() and endTransmission() methods and stop sending if there is a problem.

That is a really cool chip devdo! Thanks for bringing it to my attention.

As 6v6gt says, you can certainly use your sketch to handle any sensor error you might encounter. Locking up the device is probably not the best way to do it. Do you have a library to read the chip, or are you using Wire functions directly?

6v6gt,

I will check into the return value approach and see if I can get it working.

ChrisTenone,

I am accessing the sensor directly with the wire functions.