Hello!
I'm looking forward some diagnostic solution for this i2cEncoder, basically the I2C bus is already covered.
Since I couldn't find any CRC or inverse stored register, how can I catch any HW failure?
The best I've come up with:
int encoderErrorcounter;
while (0 == Encoder.readCounterInt())
{
encoderErrorcounter++;
Encoder.writeCounter((int32_t)65535);
if (encoderErrorcounter >= 5)
{
Serial.println("Encoder error!");
break;
}
}
Is there a better way? Or any hints welcome...
Best regards,
Andras
Hello! I'm looking forward some diagnostic solution for this i2cEncoder, basically the I2C bus is already covered. Since I couldn't find any CRC or inverse stored register, how can I catch any HW failure? The best I've come up with:
int encoderErrorcounter; while (0 == Encoder.readCounterInt()) { encoderErrorcounter++; Encoder.writeCounter((int32_t)65535); if (encoderErrorcounter >= 5) { Serial.println("Encoder error!"); break; } }
Is there a better way? Or any hints welcome... Best regards, Andras