Servo

From Let's Control It
Jump to navigation Jump to search

Servo motor control

To control a Servo Motor:

http://<ESP IP address>/control?cmd=Servo,<servo nr>,<pin>,<position>

We currently support a maximum of two servo motors so you can build a pan & tilt device if you like.

Example to set servo 1 on gpio-0 to a 90 degree position and servo 2 on gpio-2 to a 45 degree position:

http://<ESP IP address>/control?cmd=Servo,1,0,90 http://<ESP IP address>/control?cmd=Servo,2,2,45

 Beware:
 Most servos are not able to turn full 360° !

Usual servos can turn about 180° (90° in both directions from zero point).
There are some rare servos with 270° turn.

If you use a 180° type you may turn it 90° to the left or to the right.
If trying to turn more then 90° the servo runs against a stopper inside the gear.
As ESPEasy tries to go further the Servo starts humming and gets hot, it will die over time.

The third type "continuous turn servo" is not supported at this time.