Hello,
I’m using a Matek H743-mini board with Arducopter version 4.3.6 managing a hexacopter.
I am trying to read RC channel 1 and print it in QGroundControl. Channel 1 is set to pwm 1500.
Tried using this code, and getting 0 all the time. ch1 = (int)rc().channel(0)->get_control_in();
I put the code here, for testing:
// one_hz_loop - runs at 1Hz
void Copter::one_hz_loop()
after the get_control_in() I look ed further and tried this:
if((millis() - message_timer2) > 1000) {
message_timer2 = millis();
AP_HAL::RCInput *rcin = hal.rcin;
uint16_t pwm_value = 0;
if (rcin->read(0, pwm_value)) {
// Successfully read the PWM value of channel 1 (0-indexed channel 9)
gcs().send_text(MAV_SEVERITY_INFO, “Channel 1 PWM: %u”, pwm_value);
} else {
// Failed to read the PWM value of channel 1
gcs().send_text(MAV_SEVERITY_INFO, “Failed to read Channel 1 PWM”);
}
Here I’m getting “Failed to read Channel 1 PWM”.
would love any help. thanks!