Modified AdaFruit GPS library

gps.h

Committer:
StressedDave
Date:
2015-04-08
Revision:
0:7f20540d3281
Child:
1:a091e3ca8443

File content as of revision 0:7f20540d3281:

#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