GPS
Dependencies: GPS NOKIA_5110 mbed
Fork of GPS_HelloWorld by
main.cpp@1:46c38e7e02a6, 2017-09-19 (annotated)
- Committer:
- ganeshk25
- Date:
- Tue Sep 19 10:32:10 2017 +0000
- Revision:
- 1:46c38e7e02a6
- Parent:
- 0:6b7345059afe
this is 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" |
simon | 0:6b7345059afe | 3 | |
simon | 0:6b7345059afe | 4 | Serial pc(USBTX, USBRX); |
simon | 0:6b7345059afe | 5 | GPS gps(p9, p10); |
simon | 0:6b7345059afe | 6 | |
simon | 0:6b7345059afe | 7 | int main() { |
simon | 0:6b7345059afe | 8 | while(1) { |
simon | 0:6b7345059afe | 9 | if(gps.sample()) { |
simon | 0:6b7345059afe | 10 | pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude); |
simon | 0:6b7345059afe | 11 | } else { |
simon | 0:6b7345059afe | 12 | pc.printf("Oh Dear! No lock :(\n"); |
simon | 0:6b7345059afe | 13 | } |
simon | 0:6b7345059afe | 14 | } |
simon | 0:6b7345059afe | 15 | } |