For my Control Station project, I also started writing a bunch of decoding function for the FrSky telemetry protocol.

I have now moved those functions into their own library for Arduino. My focus while writing and expanding this library is on ease of use. There is already Arduino code available but I found that a bit complicated to integrate. With the new library, all the user needs to do, is read one char from the serial port and send it to the library via the ::update method. All the decoding is done internally. The ::update method returns 1 when a complete packet was received, otherwise it returns 0. There is (will be) a dedicated method to access every parameter. I'll also try to keep up the detailed documentation.

At the moment, the library decodes only the basic information, RX A1 & A2 ports, uplink and downlink RSSI. Additional sensors will be included as I receive the hardware (which hopefully is soon).

Find the library at GitHub.

Example:

#include <FrSky.h>
FrSky frsky;
void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
}
void loop() {
  if (Serial2.available()) {
    char c = Serial2.read();
    if (frsky.update(c)) { 
      Serial.print("TX RSSI: ");
      Serial.println(frsky.getLink_up());
      Serial.print("Telemetry RSSI: ");
      Serial.println(frsky.getLink_dn());
      Serial.print("RX Voltage: ");
      Serial.println(frsky.getRX_a1()*0.0517647058824);
      Serial.print("A2 Voltage: ");
      Serial.println(frsky.getRX_a2()*0.0129411764706);
    }
  }
}