How would one go about handling errors in AVR interfaces that do not specifically provide any acknowledgement scheme?
For example, I have an I2C temperature sensor which I poll every 1 hour. So every hour my AVR sends a TWI start condition to the sensor and gets the temperature at the end of it.Now tet's say for some reason the sensor does not respond. Maybe it's been taken out, burned out etc. So how can I check for such in my code and inform the user?
Right now I am using the polling method. Infinite loop till TWINT is set in the TWCR register
while ((TWCR & (1<<TWINT)) == 0){};
return TWDR;