RoboticsBrno / ServoESP32

⚙️ Generate RC servo signal on a selected pins with ESP32 device and Arduino framework.
MIT License
131 stars 31 forks source link

Servo::detach() can change servo position #19

Open dkwach opened 1 year ago

dkwach commented 1 year ago

it is useful to detach servo after movement in cases like:

In current implementation (if I understood correctly) detach() is not controlling pwm state and can disable pwm during high state and move servo to different position.

It would be great to support some safe detach, which will check if pwm is not in active state and won't change servo position. Proposal for interface:

detach(bool isSafe=false); //false default to keep backward compatibility 
or
safeDetach();