Modified AdaFruit GPS library
Diff: gps.h
- Revision:
- 0:7f20540d3281
- Child:
- 1:a091e3ca8443
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gps.h Wed Apr 08 19:06:39 2015 +0000 @@ -0,0 +1,48 @@ +#ifndef GPS_H +#define GPS_H + +#include "mbed.h" +#define knots_to_ms 0.514444444f +#define pi 3.14159265359f +#include "arm_math.h" +#include "math_helper.h" +#include "arm_common_tables.h" + +class GPS{ +public: + + GPS(void); + bool parse(char *nmea); + + float latitude; + float longitude; + float speed; + float angle; + uint8_t hour, minute, seconds, year, month, day; + uint16_t milliseconds; + bool fix; + char currentline[120]; + uint16_t lineidx; + bool newSentence; + bool firstfix; + +private: + + uint16_t parseHex(char c) { +//Converts Hex character to value - for checksum calculation + if (c <= '9') + return c - '0'; + if (c < 'A') + return 0; + if (c <= 'F') + return (c - 'A')+10; + return 0; + } + + float timef; + bool checksum; + char lat, lon; + float mins; + +}; +#endif \ No newline at end of file