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@0:ce5f06c3895f, 2012-02-22 (annotated)
- Committer:
- tylerjw
- Date:
- Wed Feb 22 03:52:43 2012 +0000
- Revision:
- 0:ce5f06c3895f
- Child:
- 1:2ace7946a246
Version 0.1
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 | 0:ce5f06c3895f | 8 | while(1) { |
tylerjw | 0:ce5f06c3895f | 9 | if(gps.sample()) { |
tylerjw | 0:ce5f06c3895f | 10 | pc.printf("I'm at %f, %f\n", gps.get_dec_longitude(), gps.get_dec_latitude()); |
tylerjw | 0:ce5f06c3895f | 11 | pc.printf("%d satelites used\n", gps.get_satelites()); |
tylerjw | 0:ce5f06c3895f | 12 | pc.printf("altitude = %f M\n\n", gps.get_msl_altitude()); |
tylerjw | 0:ce5f06c3895f | 13 | } else { |
tylerjw | 0:ce5f06c3895f | 14 | pc.printf("Oh Dear! No lock :(\n"); |
tylerjw | 0:ce5f06c3895f | 15 | } |
tylerjw | 0:ce5f06c3895f | 16 | } |
tylerjw | 0:ce5f06c3895f | 17 | } |