You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested scenario:
setting PWM_OUTPUT to 0
there is OUTPUT on PIN 1.
Just as expected.
Then setting PWM_OUTPUT to 1
there is OUTPUT on PIN 1 & PIN 2.
Did not expect that to happen.
I have tested a couple of scenarios and the pattern is, all previous used OUTPUTS will get activated.
OUTPUTS that has not yet been used is not outputting any signal.
I suspect a cleanup problem, so I extended the example to do something like this:
import sys
import time
import navio2 as navio
import navio2.pwm
import navio2.util
navio.util.check_apm()
PWM_OUTPUT = 2
SERVO_MIN = 1.250 #ms
SERVO_MAX = 1.750 #ms
#cleanup before work
for x in range(4):
with navio.pwm.PWM(x) as pwm:
pwm.set_period(1)
with navio.pwm.PWM(PWM_OUTPUT) as pwm2:
pwm2.set_period(400)
pwm2.enable()
for _ in range(20):
pwm2.set_duty_cycle(SERVO_MIN)
time.sleep(1)
pwm2.set_duty_cycle(SERVO_MAX)
time.sleep(1)
This seems to set the first 4 pins into a disabled state. Leaving all other pins in a low state while working with the selected PWM_OUTPUT.
Not sure if my observations are correct or where the actual problem is located.
If my observations are correct, I would suggest some cleanup routines in method deinitialize() in navio2/pwm.py
The text was updated successfully, but these errors were encountered:
Hello.
Tested the Servo.py example and possibly found a problem.
emlidtool info:
Tested scenario:
setting PWM_OUTPUT to 0
there is OUTPUT on PIN 1.
Just as expected.
Then setting PWM_OUTPUT to 1
there is OUTPUT on PIN 1 & PIN 2.
Did not expect that to happen.
I have tested a couple of scenarios and the pattern is, all previous used OUTPUTS will get activated.
OUTPUTS that has not yet been used is not outputting any signal.
I suspect a cleanup problem, so I extended the example to do something like this:
This seems to set the first 4 pins into a disabled state. Leaving all other pins in a low state while working with the selected PWM_OUTPUT.
Not sure if my observations are correct or where the actual problem is located.
If my observations are correct, I would suggest some cleanup routines in method deinitialize() in navio2/pwm.py
The text was updated successfully, but these errors were encountered: