Futaba SBUS reverse engineered to work with Arduino

Thank you for sharing your amazing work! I have a question, may be it is already being answered, please bare with me I am new to this :slight_smile: . From my understanding, the Sbus Protocol is a 25bytes data with 12 bits per byte and 12 X 25= 300 bits. I am trying to make Arduino communicating with NAZE 32 flight controller by using Sbus. Basically, if a ultra-sonic sensor is being used to measure the height and id it is below certain preset value, it will send a signal to increase the throttle automatically. It is a little bit confuse here, since many of the post mentioned that the Sbus data is something like this:
0x0F5C9126377FA46AAB00108000042000010870000210800C00 this is not 300 bits data and where is the start bit, paritybit and stop bit?

S-BUS protocol

The protocol is 25 Byte long and is send every 14ms (analog mode) or 7ms (highspeed mode).
One Byte = 1 startbit + 8 databit + 1 paritybit + 2 stopbit (8E2), baudrate = 100'000 bit/s
The highest bit is send first. The logic is inverted (Level High = 1)

[startbyte] [data1] [data2] .... [data22] [flags][endbyte]

startbyte = 11110000b (0xF0)

data 1-22 = [ch1, 11bit][ch2, 11bit] .... [ch16, 11bit] (ch# = 0 bis 2047)
channel 1 uses 8 bits from data1 and 3 bits from data2
channel 2 uses last 5 bits from data2 and 6 bits from data3
etc.

flags = bit7 = ch17 = digital channel (0x80)
bit6 = ch18 = digital channel (0x40)
bit5 = Frame lost, equivalent red LED on receiver (0x20)
bit4 = failsafe activated (0x10)
bit3 = n/a
bit2 = n/a
bit1 = n/a
bit0 = n/a

endbyte = 00000000b

I have tried the code in this link Arduino S-BUS Packet Generator Code - RC Groups However, it will only output 16 random hex number. I do not have any control to it.