Generation 3 of the Harp project
Dependencies: Servo TMP36 GZ buffered-serial1 chan_fatfs_sd nmea_parser watchdog mbed-rtos mbed
Fork of HARP2 by
main.cpp@2:0c9ade531a5b, 2012-02-22 (annotated)
- Committer:
- tylerjw
- Date:
- Wed Feb 22 04:37:13 2012 +0000
- Revision:
- 2:0c9ade531a5b
- Parent:
- 1:2ace7946a246
- Child:
- 3:9cba44dd2f2b
VTG parsing - no access
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tylerjw | 0:ce5f06c3895f | 1 | #include "mbed.h" |
tylerjw | 0:ce5f06c3895f | 2 | #include "GPS.h" |
tylerjw | 0:ce5f06c3895f | 3 | |
tylerjw | 0:ce5f06c3895f | 4 | Serial pc(USBTX, USBRX); |
tylerjw | 0:ce5f06c3895f | 5 | GPS gps(p9, p10); |
tylerjw | 0:ce5f06c3895f | 6 | |
tylerjw | 0:ce5f06c3895f | 7 | int main() { |
tylerjw | 1:2ace7946a246 | 8 | int gps_message; |
tylerjw | 1:2ace7946a246 | 9 | while (1) { |
tylerjw | 1:2ace7946a246 | 10 | gps_message = gps.sample(); |
tylerjw | 2:0c9ade531a5b | 11 | if (gps_message == PARSED) { |
tylerjw | 2:0c9ade531a5b | 12 | pc.printf("I'm at %f, %f\n", gps.get_dec_longitude(), gps.get_dec_latitude()); |
tylerjw | 2:0c9ade531a5b | 13 | pc.printf("%d satelites used\n", gps.get_satelites()); |
tylerjw | 2:0c9ade531a5b | 14 | pc.printf("altitude = %f M\n\n", gps.get_msl_altitude()); |
tylerjw | 2:0c9ade531a5b | 15 | } else if (gps_message == NO_LOCK) { |
tylerjw | 2:0c9ade531a5b | 16 | pc.printf("Oh Dear! No lock :(\n"); |
tylerjw | 0:ce5f06c3895f | 17 | } |
tylerjw | 0:ce5f06c3895f | 18 | } |
tylerjw | 0:ce5f06c3895f | 19 | } |