Closed Iain-S closed 1 year ago
Alternatively, we could use pigpio, which does support hardware PWM.
sudo pigpiod
python
import gpiozero
s = gpiozero.Servo(13, pin_factory=gpiozero.pins.pigpio.PiGPIOFactory())
s.min()
s.mid()
s.max()
s.value = 0.9 (close to max)
s.detach()
Closing as we do want to use gpiozero after all. See comment above for code to move a Servo.
Notes:
~Using gpiozero seemed to crash the Pi so~ we could switch to RPi.GPIO. The following is known to work but it doesn't seem to support hardware PWM (so is pretty hard to control).
Note that
note the crash could have been from trying to turn some kind of important system pin into a Servo.