gps nmea sample program
Dependencies: mbed
Fork of GPS by
main.cpp@2:a0bbb2cf21c2, 2017-03-10 (annotated)
- Committer:
- superphil06
- Date:
- Fri Mar 10 09:17:02 2017 +0000
- Revision:
- 2:a0bbb2cf21c2
- Parent:
- 1:8de9bf0961a0
gps groove sample programme
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
superphil06 | 1:8de9bf0961a0 | 1 | #include "mbed.h" |
superphil06 | 1:8de9bf0961a0 | 2 | #include "GPS.h" |
superphil06 | 1:8de9bf0961a0 | 3 | |
superphil06 | 1:8de9bf0961a0 | 4 | Serial pc(USBTX, USBRX); |
superphil06 | 1:8de9bf0961a0 | 5 | GPS gps(p9, p10); |
superphil06 | 1:8de9bf0961a0 | 6 | |
superphil06 | 1:8de9bf0961a0 | 7 | int main() { |
superphil06 | 1:8de9bf0961a0 | 8 | while(1) { |
superphil06 | 1:8de9bf0961a0 | 9 | if(gps.sample()) { |
superphil06 | 1:8de9bf0961a0 | 10 | pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude); |
superphil06 | 1:8de9bf0961a0 | 11 | } else { |
superphil06 | 1:8de9bf0961a0 | 12 | pc.printf("Oh Dear! No lock :(\n"); |
superphil06 | 1:8de9bf0961a0 | 13 | } |
superphil06 | 1:8de9bf0961a0 | 14 | } |
superphil06 | 1:8de9bf0961a0 | 15 | } |