mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Added conversions of knots to m/s and f/s
This commit is contained in:
parent
7c8093b70f
commit
98c1503bed
1 changed files with 11 additions and 3 deletions
|
@ -562,12 +562,20 @@ int32_t convertTelemetryValue(int32_t value, uint8_t unit, uint8_t prec, uint8_t
|
|||
}
|
||||
else if (unit == UNIT_KTS) {
|
||||
if (destUnit == UNIT_KMH) {
|
||||
// kts to km/h
|
||||
// kts to km/h (1 knot = 1.85200 kilometers per hour)
|
||||
value = (value * 1852) / 1000;
|
||||
}
|
||||
else if (destUnit == UNIT_MPH) {
|
||||
// kts to mph
|
||||
value = (value * 23) / 20;
|
||||
// kts to mph (1 knot = 1.15077945 miles per hour)
|
||||
value = (value * 1151) / 1000;
|
||||
}
|
||||
else if (destUnit == UNIT_METERS_PER_SECOND) {
|
||||
// kts to m/s (1 knot = 0.514444444 meters / second)
|
||||
value = (value * 514) / 1000;
|
||||
}
|
||||
else if (destUnit == UNIT_FEET_PER_SECOND) {
|
||||
// kts to f/s (1 knot = 1.68780986 feet per second)
|
||||
value = (value * 1688) / 1000;
|
||||
}
|
||||
}
|
||||
else if (unit == UNIT_CELSIUS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue