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

No need to wait after Wire.requestFrom(). #1

Open
Koepel opened this issue May 15, 2018 · 3 comments
Open

No need to wait after Wire.requestFrom(). #1

Koepel opened this issue May 15, 2018 · 3 comments

Comments

@Koepel
Copy link

Koepel commented May 15, 2018

You may remove the while (Wire.available() < 14); after the Wire.requestFrom().
Explanation: Common-mistakes#1

@lobodol
Copy link
Owner

lobodol commented May 15, 2018

Oh thanks a lot for your contribution. I'll fix it soon according to your doc.

@lobodol
Copy link
Owner

lobodol commented May 15, 2018

I opened a new pull request : #2
What do you think is the best way to handle Wire error ?

@Koepel
Copy link
Author

Koepel commented May 15, 2018

To check or not to check for errors ? then my advice is at the bottom of the page: Check for bus errors ?

It is possible to keep the last error in a variable. That can be used if something goes wrong.

It is also possible to increment an error count. That error count can be checked every few hours and if it was increased then the quality of the I2C bus has a problem. This is very useful for diagnostics. It could be displayed on a special diagnostics or service page.

It is possible to do a few retries when the I2C went wrong.

In my opinion this all could be useful, but not with the Arduino Wire library. The Arduino Wire library does not handle I2C bus problems very well itself.

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

2 participants