Thanks much for the suggestion. That did appear to be the problem as it does solve the issue, the servo does go quiet. Problem with this workaround is that I have to delay 700mS between the acquire and detach or it stops the servo before it reaches it's final position (since I now have to attach and detach between each target rotation angle/position).
sonarServo.attach(9);
theServo->write(pos); // tell servo to go to position in variable 'pos'
delay(700); // give time to get to position or detach will stop rotation early
sonarServo.detach(); // detach servo to keep it quiet for next PING scan ![]()
This is extremely painful when scanning a 180 degree area (even if it scans at 5 degree intervals, that ends up being more than 25 seconds to scan 180 degrees, not including actual PING scan time at each stop along the way). Can you give me anymore detail as to the bug this is working around, or any other possible ways to address or work around this without sacrificing so much scan time? I'm using Arduino 1.0.1 on a Mac and it's using a Servo.cpp file that's "Version 2" from 2009. Is there a newer library out there? Poking around on this site, I found code for a Servo.cpp that had a "servo::refresh()" call in it that my version doesn't seem to have, although the version with the "refresh()" looked much less complicated, but contained no versioning information.
Thanks,
-- Nick