Wait (20,msec)

Why do we need to wait(20, msec) for the while loop?

is there any reason we need to adjust this value?

You’re giving the brain a chance to do other tasks in the background, like reading sensors and other things to keep programs functioning. You can make it longer, I wouldn’t make it much shorter.

3 Likes

It gives the brains CPU a break for another background tasks to run. You could decrease it down to 10 msec but a difference of 10 msec (0.01 seconds) is not significantly noticable by a human driver.

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.