Loading ...
Sorry, an error occurred while loading the content.

sonar conflicts with multiple threads

Expand Messages
  • graniterose2003
    the parallax ping sonar rangefinder could give spurious results if more than one thread is doing ping/sleep/get -- e.g. a navigator thread and the
    Message 1 of 1 , Aug 5, 2011
    • 0 Attachment
      the parallax ping sonar rangefinder could give spurious results if more than one thread is doing ping/sleep/get -- e.g. a navigator thread and the screenmanager thread. if it happens that two getDistance follow each other, then the 2nd will return with -1. Or if two ping's follow each other, then the getDistance could return a "closer" distance because the receiver gets the return pulse from the first ping, but the timer is set from the last ping.

      One could synchronize the ping/sleep/get sequence, or insure only one sonar thread is running.
    Your message has been successfully submitted and would be delivered to recipients shortly.