Pixhawk with FrSky 8XR has no PWM reading in Arduino

I tried to read a PWM signal from Pixhawk by connecting it to Arduino. The Pixhawk is connected to FrSky X8R. But my PWM always reads to zero.

Here’s my arduino code:

#define RCPin 4
int RCValue;

void setup() {
  Serial.begin(9600);
  pinMode(RCPin, INPUT);
}

void loop() {
  RCValue = pulseIn(RCPin, HIGH,25000);
  Serial.println(RCValue);
}

Here is also my wiring. Pixhawk’s RCIN is connected to X8R’s SBUS
.

Hello @johnmeeel

I saw in the picture that you are trying to read MAIN1 output, which should be a motor output. Have you ever armed your pixhawk? If don’t, it won’t output anything there.

My suggestion is to check your BRD_PWM_COUNT parameter, be sure that it is at least 1 and then use the mission planner tab “Servo/Relay” to command Output number 9 with the values you want by filling the boxes with the PWM values and clicking High and Low to command it.

Also, make sure you are properly powering up your pixhawk.

So, pixhawk wont have any output since its not armed.

How about if I connect outputs 1 and 3 to an L129N Driver Motor

The outputs dedicated to motors will not work until armed (for instance, MAIN 1-4 for a quadcopter, MAIN 1-6 for hexa, etc). All other ones can work based on what I explained you, if you input a value for them.

I didn’t understand how this setup would work if you need PWM output.

1 Like

Thanks for your input on this one. It did helped :smiley:

1 Like