-
Notifications
You must be signed in to change notification settings - Fork 40
provide a way to turn off a Servo #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
yep agree. this is because 'zero' in servo land is 0.5ms pulse, not actually off |
Or via an >>> servo.enabled
True
>>> servo.enabled = False # turns it "off"
>>> servo.enabled = True # turns it back "on" |
If there's an |
i think no, you should be able to have enabled on/off while changing .fraction without it moving. once its disabled, it should not move! |
FYI, Motor does this with |
IS there any update on this. This is a big difference between the Python2 Adafruit libraries and the Circuit Python Python3 libraries. We need a parity in features, or at least a work around. |
What about allowing -1 to actuation range as the angle? 0 is no angle, -1 is off with no change? From the angle_setter if new_angle < -1 or new_angle > self.actuation_range: This would allow us to simply issue an angle command, and then issue a -1 without changing the last angle set. It also doesn't "disable" or anything the servo, it's just ready for the next command. |
added in #27 |
fixed by #27 |
Servo
doesn't have a way of setting the duty cycle to zero, so that the servo becomes unpowered completely. In Arduino land,detach()
does that, because it removes the connection to the (hidden) pwm object (if I understand correctly).@caternuson was trying to translate the first example here: https://learn.adafruit.com/analog-feedback-servos/servos-as-input-devices and encountered the API differences.
Proposal: add a
turn_off()
method, which sets thePWMOut
duty cycle to zero. Setting the.fraction
to any value after that will repower the servo to some non-zero duty cycle.Tagging @tannewt, @TheKitty, and @ladyada here for any comments they may have.
The text was updated successfully, but these errors were encountered: