Hi,
I hope all is well.
I’m using pymavlink to control the PWM signals on my Navigator board. I connected cables to the S pin (power) and the - pin (GND) to create a circuit with an LED. I was able to send a signal to turn channel 16 ON, which successfully turned on the LED.
However, the issue I’m facing now is that I’m unable to turn the LED off. It seems to stay on all the time. I’ve tried rebooting the Navigator and reflashing ArduSub, but the LED remains on. I also tried sending a signal to set the voltage to zero, but the light is still on.
This is the code I’m using to try to turn off the LED:
from pymavlink import mavutil
master = mavutil.mavlink_connection('udp:0.0.0.0:14550')
master.wait_heartbeat()
def force_deactivate_pwm(channel):
pwm_value = 0
master.mav.command_long_send(
master.target_system,
master.target_component,
mavutil.mavlink.MAV_CMD_DO_SET_SERVO,
0,
channel,
pwm_value,
0, 0, 0, 0, 0
)
print(f"Forced deactivate command sent to channel {channel} with PWM {pwm_value}")
# Try to deactivate both PWM on channels 15 and 16
force_deactivate_pwm(15)
force_deactivate_pwm(16)
Could someone help me understand what I might be doing wrong?
Thank you very much.