I’m trying to control a Tower Pro SG92R servo through Navio’s PWM Output channel 14. Is this possible and how would I do it?
I have tried the example code from Emlid that is labeled Servo.py, but all it returns is an error message that says “APM is running. Can’t launch example.”
I’m really new to this so pardon me for any dumb mistakes! All help is appreciated!
The message “APM is running. Can’t launch example.” means that you need to stop Ardupilot on your Navio2 before launching the test. You can do it via emlidtool or with the following command:
However, when I run Servo.py now, it shows this error:
OSError: [Errno 19] No such device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “Servo.py”, line 14, in
with navio.pwm.PWM(PWM_OUTPUT) as pwm:
File “/home/pi/Navio2/Python/navio/pwm.py”, line 15, in enter
self.initialize()
File “/home/pi/Navio2/Python/navio/pwm.py”, line 34, in initialize
pwm_export.write(str(self.channel))
OSError: [Errno 19] No such device