VPManske / Digital-White-Cane

The Digital White Cane is a primary electronic mobility head mount aid for use by people who are blind or visually impaired; it is a major "step forward" in assistive technology that allows safe obstacle avoidance and permits navigation around obstacles both in the user's forward path and whatever direction the user turns their head before walking in that direction, giving valuable protection at head/chest height while the cane still cover ground obstacles.
4 stars 3 forks source link

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

Open Koepel opened 7 years ago

Koepel commented 7 years ago

In the file "Digital-White-Cane/three programs that kinda work/first/sketchSept2C/sketch_sep02c.ino", you use this after a Wire.requestFrom(): while (Wire.available() < 1) delay(1);

However, there is nothing to wait for. You can remove all those while-loops.

When the Wire.requestFrom() returns, the I2C transaction has completely finished and the received data is waiting in a buffer in the Wire library.