Example Program for the sIRFstarIII Library

Dependencies:   mbed

Committer:
p3p
Date:
Tue Apr 03 12:16:09 2012 +0000
Revision:
1:b1c95f8edfec
Parent:
0:999ed846ba1e
new baud interface disabled dma

Who changed what in which revision?

UserRevisionLine numberNew contents of line
p3p 0:999ed846ba1e 1 #include "mbed.h"
p3p 0:999ed846ba1e 2 #include "GpsInterface.h"
p3p 0:999ed846ba1e 3
p3p 0:999ed846ba1e 4 Serial debug(USBTX, USBRX);
p3p 0:999ed846ba1e 5 Timer timer;
p3p 0:999ed846ba1e 6
p3p 0:999ed846ba1e 7 SirfStarIII::GpsInterface gps(p13,p14);
p3p 0:999ed846ba1e 8
p3p 0:999ed846ba1e 9 int main() {
p3p 0:999ed846ba1e 10 debug.baud(115200);
p3p 0:999ed846ba1e 11 debug.printf("GPS TEST FIRMWARE\r\n");
p3p 0:999ed846ba1e 12
p3p 1:b1c95f8edfec 13 gps.initialise(SirfStarIII::NMEA, 4800);
p3p 1:b1c95f8edfec 14
p3p 0:999ed846ba1e 15 timer.start();
p3p 1:b1c95f8edfec 16
p3p 0:999ed846ba1e 17 while (1) {
p3p 0:999ed846ba1e 18 gps.update();
p3p 0:999ed846ba1e 19
p3p 0:999ed846ba1e 20 if (timer.read_ms() > 1000) {
p3p 0:999ed846ba1e 21 timer.reset();
p3p 0:999ed846ba1e 22 debug.printf("%02d/%02d/%d %02d:%02d:%02d - %f, %f\r\n", gps._time.day, gps._time.month, gps._time.year, gps._time.hours, gps._time.minutes, gps._time.seconds, gps._position.latitude._dec_degrees, gps._position.longitude._dec_degrees);
p3p 0:999ed846ba1e 23 }
p3p 1:b1c95f8edfec 24
p3p 0:999ed846ba1e 25 }
p3p 0:999ed846ba1e 26 }