8 years ago.

Servo motor

How can I control the servo to rotate 90° clockwise and reverse back 90°?

1 Answer

8 years ago.

The Servo class written by Simon Ford uses a normalised parameter range 0..1 to move from leftmost to rightmost position. How much the servo moves in degrees depends on the servo type and possibly mechanical gears between the servo and your servo arm. The Servo class does allow you to calibrate the relationship between normalised range and angle to match your hardware. See here for documentation. However, 90 degrees is often the max range of a servo. Try servo=1.0 to rotate 90 and servo=0.0 to reverse.

Accepted Answer