I need help in being able to control a servo via code - not using radio controller input.
I cannot control the PWM outputs of pins 6 and 7, and i dont know why, any help appreciated.
Using nsh terminal (pwm test -c 67 -p 1000) works as expected.
This is on the X-quadrotor configuration, Pixhawk FC.
I have also tried using topic actuator_controls_0 to test.
Aim is to set pin 6 to max pwm and pin 7 to min pwm.
Alternatively, i can use PWM AUX 1 and AUX 2 if easier.
I tried following bottle_drop.cpp code to get this.
This code is in task_main() in a custom app. Outputs in nsh terminal shows it definately gets into the loop.
NOTE: Do not refer me to the px4 gymbal example for gymbal control, as this is intentionally set up as a custom app for custom purposes.
warnx("Gymbal Control Started!");
orb_copy(ORB_ID(external_cmd), _ext_cmd_sub, &_ext_cmd);
_actuators.control = 1.0f;
_actuators.control = -1.0f;
_actuators.timestamp = hrt_absolute_time();
if (_actuator_pub != nullptr)
orb_publish(ORB_ID(actuator_controls_2), _actuator_pub, &_actuators);
_actuator_pub = orb_advertise(ORB_ID(actuator_controls_2), &_actuators);
Thanks for any help you can provide!