[SOLVED] How to release servo positioning signal?

Is there an EasyGoPiGo3 API to turn off a servo positioning signal?
(While debugging my servo control methods, it was holding an awkward position. I needed to force a release of the servo positioning. )

PAN_SERVO="SERVO1"
TILT_SERVO="SERVO2"
egpg=easygopigo3.EasyGoPiGo3(use_mutex=True)
ps=egpg.servo_init(PAN_SERVO)
ts=egpg.servo_init(TILT_SERVO)

?? Turn off servo positioning signal before exiting ??

I wouldn’t always want to do this, but it would be nice to have a “servos_off.py”

1 Like

You can use set_servo to set the pulse width to 0uS (turn off the signal) which will cause the servo to float. To call set_servo to float the servos with your code, you can use something like this:

ps.gpg.set_servo(ps.portID, 0)
ts.gpg.set_servo(ts.portID, 0)
2 Likes

Super! Thanks

Please marked this SOLVED

2 Likes

Hi @cyclicalobsessive,

We added a simple method to disable the servos and we have documented it. You can check the method here:

https://gopigo3.readthedocs.io/en/master/api-basic/sensors.html#easysensors.Servo.disable_servo

And our PR here:

Hopefully, this will make things easier for you and for everyone else.

Thank you!

2 Likes

This topic was automatically closed after 30 hours. New replies are no longer allowed.