This example's program for communication with Locosys GPS module model 1590R-A. Reference: https://sites.google.com/site/domediy/gpstest
Dependencies: GPS PowerControl mbed
Fork of GPS_HelloWorld by
main.cpp@1:39b2575a0211, 2013-09-27 (annotated)
- Committer:
- udomsak
- Date:
- Fri Sep 27 09:39:07 2013 +0000
- Revision:
- 1:39b2575a0211
- Parent:
- 0:6b7345059afe
Test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 0:6b7345059afe | 1 | #include "mbed.h" |
simon | 0:6b7345059afe | 2 | #include "GPS.h" |
udomsak | 1:39b2575a0211 | 3 | #include "PowerControl/EthernetPowerControl.h" |
simon | 0:6b7345059afe | 4 | |
simon | 0:6b7345059afe | 5 | Serial pc(USBTX, USBRX); |
simon | 0:6b7345059afe | 6 | GPS gps(p9, p10); |
simon | 0:6b7345059afe | 7 | |
simon | 0:6b7345059afe | 8 | int main() { |
udomsak | 1:39b2575a0211 | 9 | PHY_PowerDown(); |
simon | 0:6b7345059afe | 10 | while(1) { |
simon | 0:6b7345059afe | 11 | if(gps.sample()) { |
udomsak | 1:39b2575a0211 | 12 | pc.printf("I'm at %f, %f\n\r", gps.longitude, gps.latitude); |
simon | 0:6b7345059afe | 13 | } else { |
simon | 0:6b7345059afe | 14 | pc.printf("Oh Dear! No lock :(\n"); |
simon | 0:6b7345059afe | 15 | } |
simon | 0:6b7345059afe | 16 | } |
simon | 0:6b7345059afe | 17 | } |