I used servo.py to rotate my servo motor (connected to pin 6), it work did work. However, the next day I run it with no changes made on the code, it appeared error.
Require urgent help. Thank you in advance the code:
import sys
import time
import navio.pwm
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)
the error:
Traceback (most recent call last):
File “try.py”, line 9, 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))
IOError: [Errno 1] Operation not permitted