Why the problem occurs?
RC servos set their position accordingly to width of a pulses sent to them. Usually this width changes in range of ~500 - 2500us, with a frequency of 50Hz. When a servo receives such a signal, it goes to a corresponding position. For example - if it receives pulses 1500us wide, it would go to middle position. When you invoke servo.attach()
, Arduino will start sensing pulses of DEFAULT_PULSE_WIDTH
which happens to be 1500us.
What can be done about that?
The solution from the linked question applies also to standard Arduino servo library. Find DEFAULT_PULSE_WIDTH
and change it's value to 0. If there are no pulses, the servo won't turn. Arduino will start sending signal after first servo.write()
call. Remember, that there will be no holding torque until that time.