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.
GPS Class Reference
A GPS interface for reading from a Globalsat EM-406 GPS Module. More...
#include <GPS.h>
Public Member Functions | |
| GPS (PinName tx, PinName rx) | |
| Create the GPS interface, connected to the specified serial port. | |
| int | sample () |
| Sample the incoming GPS data, returning whether there is a lock. | |
Data Fields | |
| float | longitude |
| The longitude (call sample() to set) | |
| float | latitude |
| The latitude (call sample() to set) | |
| float | utc |
| The UTC time. | |
| int | fix |
| fix quality | |
| int | fix_3d |
| fix3D fix - values include: 1 = no fix,2 = 2D fix,3 = 3D fix | |
| float | altitude |
| Altitude, Meters, above mean sea level. | |
| int | sat_tracked |
| Number of satellites being tracked. | |
| float | speed |
| dilution of precision (PDOP) | |
| int | date |
| date of object | |
| int | id1 |
| PRNs (IDS) of satellites used for fix (space for 12) | |
Detailed Description
A GPS interface for reading from a Globalsat EM-406 GPS Module.
Definition at line 29 of file GPS.h.
Constructor & Destructor Documentation
| GPS | ( | PinName | tx, |
| PinName | rx | ||
| ) |
Member Function Documentation
| int sample | ( | ) |
Sample the incoming GPS data, returning whether there is a lock.
- Returns:
- 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0
$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39
Where: GSA Satellite status A Auto selection of 2D or 3D fix (M = manual) 3 3D fix - values include: 1 = no fix 2 = 2D fix 3 = 3D fix 04,05... PRNs of satellites used for fix (space for 12) 2.5 PDOP (dilution of precision) 1.3 Horizontal dilution of precision (HDOP) 2.1 Vertical dilution of precision (VDOP) 39 the checksum data, always begins with
Field Documentation
| int fix_3d |
| int sat_tracked |
| float speed |
Generated on Wed Jul 20 2022 06:38:29 by
1.7.2