Skip to content

Commit

Permalink
FRSKY Standard Telemetry Support of Kilometers/Hour for OpenTX
Browse files Browse the repository at this point in the history
git-svn-id: http://multiwii.googlecode.com/svn/trunk/MultiWii_shared@1778 02679b44-d973-9852-f2fa-63770883b36c
  • Loading branch information
Quadbow authored and Quadbow committed Jul 19, 2015
1 parent 85a1184 commit 94e23e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
8 changes: 6 additions & 2 deletions Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ void inline send_GPS_speed(void)
uint16_t Data_GPS_speed_ap;
uint16_t temp;
if (f.GPS_FIX && GPS_numSat >= 4) {
temp = (GPS_speed * 40 + 102) / 203; // FRSKY specific format in knots => factor ~50 (102 for rounding purpose)
Data_GPS_speed_bp = temp / 10;
#if defined KILOMETER_HOUR // OPENTX specific format in kilometers per hour => factor 36/100 (will be devided by 10 later)
temp = (GPS_speed * 36) / 10;
#else // FRSKY specific format in knots => factor ~50 (will be devided by 10 later)
temp = (GPS_speed * 40) / 203;
#endif
Data_GPS_speed_bp = temp / 10; // here comes the devision by 10
Data_GPS_speed_ap = temp - Data_GPS_speed_bp * 10;
sendDataHead(ID_GPS_speed_bp);
write_FrSky16(Data_GPS_speed_bp);
Expand Down
18 changes: 11 additions & 7 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -880,26 +880,30 @@ Also note, that maqgnetic declination changes with time, so recheck your value e
/********************************************************************/
/**** TELEMETRY ****/
/********************************************************************/
// select one of the two protocols depending on your receiver
//#define FRSKY_TELEMETRY // used for FRSKY twoway receivers with telemetry (D-series like D8R-II or D8R-XP)
// VBAT, Baro, MAG, GPS and POWERMETER are helpful
// VBAT_CELLS is optional for a forth screen on the display FLD-02
//#define SPORT_TELEMETRY // for FRSKY twoway receivers with S.PORT telemetry (S-series like X4R/X6R/X8R), not implemented yet - TO BE DONE

// A2 voltage is represented by a value in the range 0-255.
// So if you set the max for A2 to be 12.4 each step will increase the displayed voltage by ~0.0486
#define FRSKY_SPORT_A2_MAX 124 // NOTE: VBAT gets stored as an integer. 16 would be 1.6V, 124 is 12.4V, etc etc

// FRSKY common entries - valid for both protocols
#define TELEMETRY_SERIAL 3 // change if required
#define COORDFORMAT_DECIMALMINUTES // uncomment to get the format DD°MM.mmmm for the coordinates - comment out to get the format DD.dddddd° for the coordinates

// FRSKY standard telemetry specific devices
#define FRSKY_FLD02 // send only data specific for the FRSKY display FLD-02
// comment out for OpenTX and Er9x, all data will be sent via FRSKY protocol
//#define OPENTX // send OpenTX specific data
//#define ER9X // send Er9x specific data, not implemented yet - TO BE DONE FOR THE FUTURE

// FRSKY standard telemetry specific selections
//#define COORDFORMAT_DECIMALMINUTES // uncomment to get the format DD°MM.mmmm for the coordinates - comment out to get the format DD.dddddd° for the coordinates
//#define KILOMETER_HOUR // send speed in kilometers per hour instead of knots (default) - requested by OPENTX
#define TELEMETRY_ALT_BARO // send BARO based altitude, calibrated to 0 when arming, recommended if BARO available
//#define TELEMETRY_ALT_GPS // send GPS based altitude (altitude above see level), for FLD-02 don't use together with TELEMETRY_ALT_BARO
#define TELEMETRY_COURSE_MAG // send MAG based course/heading, recommended if MAG available, but FLD-02 does not display
//#define TELEMETRY_COURSE_GPS // send GPS based course/heading, don't use together with TELEMETRY_COURSE_MAG, FLD-02 does not display

// S.PORT specific entries
#define FRSKY_SPORT_A2_MAX 124 // A2 voltage is represented by a value in the range 0-255. A value of 16 results in 1.6V, 124 is 12.4V, etc

/********************************************************************/
/**** Buzzer ****/
/********************************************************************/
Expand Down

0 comments on commit 94e23e4

Please sign in to comment.