Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of NEO-6m-GPS by
Diff: GPS.h
- Revision:
- 1:1d60e6a0ffd9
- Parent:
- 0:15611c7938a3
- Child:
- 2:7350eda5fa8c
--- a/GPS.h Tue Jun 08 14:10:27 2010 +0000
+++ b/GPS.h Sat Nov 02 16:17:58 2013 +0000
@@ -1,5 +1,6 @@
-/* mbed EM-406 GPS Module Library
+/* mbed GPS Module Library
* Copyright (c) 2008-2010, sford
+ * Copyright (c) 2013, B.Adryan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -25,13 +26,15 @@
#ifndef MBED_GPS_H
#define MBED_GPS_H
-/** A GPS interface for reading from a Globalsat EM-406 GPS Module */
+/** A GPS interface for reading from a serial GPS module */
class GPS {
public:
- /** Create the GPS interface, connected to the specified serial port
+ /** Create the GPS interface, connected to the specified serial port and speed.
+ * for example, GlobalSat EM406-A (e.g. on SparkFun GPS Shield) is 4800 Baud,
+ * Adafruit Ultimate GPSv3 (connected to serial) is 9600 Baud
*/
- GPS(PinName tx, PinName rx);
+ GPS(PinName tx, PinName rx, int Baud);
/** Sample the incoming GPS data, returning whether there is a lock
*
@@ -45,13 +48,33 @@
/** The latitude (call sample() to set) */
float latitude;
+ /** The time (call sample() to set) */
+ float time;
+
+ /** Number of satellites received (call sample() to set) */
+ int sats;
+
+ /** Horizontal dilusion of precision (call sample() to set) */
+ float hdop;
+
+ /** The altitude (call sample() to set)
+ Note that the accurate altitude is corrected by the geoid
+ See http://homepages.slingshot.co.nz/~geoff36/datum.htm
+ */
+ float alt;
+
+ /** The geoid (call sample() to set) */
+ float geoid;
+
+ /** The NMEA sentence */
+ char msg[256];
+
+
private:
float trunc(float v);
void getline();
Serial _gps;
- char msg[256];
-
};
-#endif
+#endif
\ No newline at end of file
