Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Econder diagnostic question #8

Open
u4mzu4 opened this issue Oct 7, 2019 · 0 comments
Open

Econder diagnostic question #8

u4mzu4 opened this issue Oct 7, 2019 · 0 comments

Comments

@u4mzu4
Copy link

u4mzu4 commented Oct 7, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant