Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding speed_metersps function #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/GPSfix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down Expand Up @@ -588,4 +590,4 @@ class gps_fix

} NEOGPS_PACKED;

#endif
#endif