From fd9f9c6b51b2298abcb555d4022d5caa1e6c13a2 Mon Sep 17 00:00:00 2001 From: CrNMGuy Date: Fri, 10 Aug 2018 19:15:37 +0200 Subject: [PATCH] Adding speed_metersps function --- src/GPSfix.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GPSfix.h b/src/GPSfix.h index 8c456e7..2b750e4 100644 --- a/src/GPSfix.h +++ b/src/GPSfix.h @@ -160,6 +160,8 @@ class gps_fix CONST_CLASS_DATA uint32_t M_PER_NMI = 1852; uint32_t speed_metersph() const { return (spd.whole * M_PER_NMI) + (spd.frac * M_PER_NMI)/1000; }; + + uint32_t speed_metersps() const { return ((spd.whole * M_PER_NMI) + (spd.frac * M_PER_NMI)/1000 ) / 3600; }; CONST_CLASS_DATA float MI_PER_NMI = 1.150779; float speed_mph() const { return speed() * MI_PER_NMI; }; @@ -588,4 +590,4 @@ class gps_fix } NEOGPS_PACKED; -#endif \ No newline at end of file +#endif