SBUS out protocol

Hello, I am attempting to take the SBUS data out of my Pix2 using the “SBUS out” port and read it into an arduino board. I have recently done this same setup but instead of taking SBUS out of my Pixhawk, I took it out of my futaba reciever. Using the git repo found here it works great. Takes in the channels no problem. When hooking in the pixhawk 2 instead the data is not correct at all. It seems the channels are all jumbled and not in the original ordering. I was wondering what the difference would be between the pixhawk SBUS encoding procedure and the futaba procedure? What would make this library work for one and not the other? Not familir with how SBUS encoding works. Any insight on SBUS or how the pixhawk 2 outputs the SBUS signal would be greatly appreciated.

The Pixhawk only sends Sbus output for the servo outputs that are active/have a function assigned. If you have configured servo out 1,2,5, the Sbus stream will contain channel 1,2 and 5. I tested this with a Wing F765 running Inav. It worked with both a Frsky receiver and a Pixhawk over Sbus. The Frsky receiver did send a 16ch stream, the Pixhawk only the configured outputs.

@count74 kindly share the sbus library you used to decode sbus data from pixhawk.
Thanks in advance.

Where did I mention a library? I used a pixhawk with ardurover for navigation control and Inav on a F765 board for low level stability control for a balancebot, if I remember correctly.

I think he refers to the link of @Tristan_Williams , it works great on a Teensy

Thanks @count74 and @ppoirier.
I wrote an arduino code to read the sbus data from x8r receiver and then control the servos attached. But now instead of x8r, I am directly using pixhawk to send sbus data…it is not working.
So I am looking for a solution to this.

Looking at SBUS out on this forum, depending on your Flight Controller , you might have to use a standard serial port with a signal inverter