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 dgps by
Diff: main.cpp
- Revision:
- 1:aef1562834b4
- Parent:
- 0:9c001c4e7bf4
--- a/main.cpp Sun Feb 16 21:26:54 2014 +0000 +++ b/main.cpp Sun Feb 16 22:12:47 2014 +0000 @@ -7,9 +7,9 @@ Serial gps(p28,p27); typedef struct { - int latitude; //in .0001 minutes - int longitude; //in .0001 minutes - int altitude; //in decimeters + int latitude; //in 0.0001 minutes + int longitude; //in 0.0001 minutes + int altitude; //in 0.1 m int time; //in milliseconds } GpsData; @@ -101,6 +101,12 @@ otherGps.latitude, otherGps.longitude, otherGps.altitude, otherGps.time ); reading = false; + pc.printf("Lat: %d, Lon: %d, Alt: %d, Time: %d\r\n", + gpsData.latitude - otherGps.latitude, + gpsData.longitude - otherGps.longitude, + gpsData.altitude - otherGps.altitude, + gpsData.time - otherGps.time + ); } } else if (c == 'X'){ reading = true; @@ -132,9 +138,9 @@ gpsData.altitude = parseDec(field); //update whatever needs updating when gps updates - pc.printf("My GPS data: Lat: %d, Lon: %d, Alt: %d, Time:%d\r\n", - gpsData.latitude, gpsData.longitude, gpsData.altitude, gpsData.time - ); +// pc.printf("My GPS data: Lat: %d, Lon: %d, Alt: %d, Time:%d\r\n", +// gpsData.latitude, gpsData.longitude, gpsData.altitude, gpsData.time +// ); line.str(string("")); reading = false; @@ -154,7 +160,6 @@ pc.baud(57600); // sendGpsCommand("PMTK301,1"); -// while(true){pc.putc(gps.getc());} gps.attach(&handleGpsData, Serial::RxIrq); -// xbee.attach(&handleXbeeGps, Serial::RxIrq); + xbee.attach(&handleXbeeGps, Serial::RxIrq); }