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 Aug 25, 2017 · 0 comments
Open

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

Koepel opened this issue Aug 25, 2017 · 0 comments

Comments

@Koepel
Copy link

Koepel commented Aug 25, 2017

When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library. There is no need to wait for something.

In the file "protopaja-sick/src/rosserial_arduino/src/ros_lib/examples/Temperature/Temperature.pde" you have added a delay(10); after the Wire.requestFrom(). You can remove that delay.

In the file "protopaja-sick/src/rosserial_arduino/src/ros_lib/examples/BlinkM/BlinkM_funcs.h" you can remove the waiting after the Wire.requestFrom(), that is the while( Wire.available() < 5 ) ; and the while( Wire.available() < 4 ) ;. I know you did not write it and it is not a big deal. I will create an issue at todbot as well.

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