Closed llewelld closed 1 year ago
thanks for your contribution @llewelld !
unfortunately, I currently do not have the capacity to test this. see https://github.com/rahul-thakoor/rust_gpiozero/issues/11 I can add you as a maintainer if you are up for it :)
or, perhaps @dcroote is able to test this?
Thanks @rahul-thakoor for your reply (I missed #11 so hadn't appreciated this was the situation).
If @dcroote is able to help then I'd appreciate the additional eyes.
More broadly if the objective is to ultimately try to replicate the functionality of Python GPIO Zero then that's something I'd be interested to help with. While I appreciate the offer as a way to move things forwards, I'd prefer to try to tackle some existing issues, or fill some gaps between this and the Python version, before you consider me as a maintainer.
Thanks- I will need a few days but I'd be happy to have a look
This change adds a
detach()
method to theServo
class, which allows the servo to be "stopped". This can be important for software-PCM-controlled servos and for minimising CPU usage.For comparison with the equivalent implementation in the Python GPIO Zero implementation, see the relevant:
detach
callsvalue.setter
which callsRPiGPIOPin._set_frequency()
which then finally callsGPIO.PWM.stop()
;IoPin::clear_pwm()
callssoft_pwm.stop()
.I'd be grateful if you'd consider this for incorporation into the library. This PR builds on @RustyPro's nice #28 changes for adding a
set_position()
implementation, which I've also found to be a useful and important addition to the library.