Remember servo position after detach()

When you call detach, the refreshing of the servo stops and it wont hold the position any more. So far, so good.

When you call attach, the servo will move to the position it is set to, which by default is some kind of middle position at 1500 microseconds. If you don,t like this, call writeMicroseconds() before calling attach(). Write would work too, but you might not have set the high and low parameter correctly so the mapping from degree to microseconds might not be correct.

In short, a servo doesn't need to be attached to write to it, but the position will only be applied once the servo is attached too.

That should resolve your problem.

However if you would like to know in what position the servo currently is because it was moved manually while detached, you're out of luck. I can't think of a way to get this information.

Korman