Aerodyne
/
Venus838_Test
Test program for Venus838 library
Fork of Venus838_Test by
main.cpp@1:6682e439dc5e, 2014-06-24 (annotated)
- Committer:
- ethanharstad
- Date:
- Tue Jun 24 04:49:00 2014 +0000
- Revision:
- 1:6682e439dc5e
- Parent:
- 0:38958ff5de62
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ethanharstad | 0:38958ff5de62 | 1 | #include "mbed.h" |
ethanharstad | 0:38958ff5de62 | 2 | #include "Venus838.h" |
ethanharstad | 0:38958ff5de62 | 3 | |
ethanharstad | 0:38958ff5de62 | 4 | Serial pc(USBTX, USBRX); |
ethanharstad | 0:38958ff5de62 | 5 | Venus838 gps(PA_11, PA_12); |
ethanharstad | 0:38958ff5de62 | 6 | |
ethanharstad | 0:38958ff5de62 | 7 | int main() { |
ethanharstad | 0:38958ff5de62 | 8 | pc.baud(115200); |
ethanharstad | 0:38958ff5de62 | 9 | gps.setNavigationMode(4); |
ethanharstad | 0:38958ff5de62 | 10 | wait_ms(100); |
ethanharstad | 0:38958ff5de62 | 11 | gps.setUpdateRate(10); |
ethanharstad | 0:38958ff5de62 | 12 | wait_ms(100); |
ethanharstad | 0:38958ff5de62 | 13 | gps.setNmeaMessages(true, false, false, false, true, false); |
ethanharstad | 0:38958ff5de62 | 14 | while(true) { |
ethanharstad | 0:38958ff5de62 | 15 | if(gps.readable()) pc.putc(gps.getc()); |
ethanharstad | 0:38958ff5de62 | 16 | if(pc.readable()) gps.putc(pc.getc()); |
ethanharstad | 0:38958ff5de62 | 17 | } |
ethanharstad | 0:38958ff5de62 | 18 | } |