Servo.py:
import sys
import time
import navio.pwm
import navio.util
navio.util.check_apm()
PWM_OUTPUT = 0
SERVO_MIN = 1.250 #ms
SERVO_MAX = 1.750 #ms
with navio.pwm.PWM(PWM_OUTPUT) as pwm:
pwm.set_period(50)
pwm.enable()
while (True):
pwm.set_duty_cycle(SERVO_MIN)
time.sleep(1)
pwm.set_duty_cycle(SERVO_MAX)
time.sleep(1)
when i run Python Servo.py am getting this error message:
Traceback (most recent call last):
File “Servo.py”, line 21, in
time.sleep(1)
File “/home/pi/Navio2/Python/navio/pwm.py”, line 19, in exit
self.deinitialize()
File “/home/pi/Navio2/Python/navio/pwm.py”, line 25, in deinitialize
with open(self.SYSFS_PWM_UNEXPORT_PATH, “a”) as pwm_unexport:
IOError: [Errno 13] Permission denied: ‘/sys/class/pwm/pwmchip0/unexport’
how can i solve this?