A GPS serial interrupt service routine that has an on the fly nmea parser. Works with a STM32F411RE and a Adafruit GPS logger.
Dependents: Bicycl_Computer_NUCLEO-F411RE Bicycl_Computer_NUCLEO-L476RG
Fork of GPS by
main.cpp
#include "mbed.h" #include "GPSISR.h" #define PIN_RX_GPS PA_12 //GPS Shield RX pin #define PIN_TX_GPS PA_11 //GPS Shield TX pin Serial pc(USBTX, USBRX); // Set up serial interrupe service handler for gps characters. GPS MyGPS(PIN_TX_GPS,PIN_RX_GPS, 9600); int main() { while (1) { if (MyGPS.dataready()) { MyGPS.read(); pc.printf("NMEA has valid data"); pc.printf("Sats : %d \n", MyGPS.buffer.satellites); pc.printf("%d-%d-%d\n", MyGPS.buffer.month, MyGPS.buffer.day, MyGPS.buffer.year); pc.printf("%d:%d:%d\n", MyGPS.buffer.hours, MyGPS.buffer.minutes, MyGPS.buffer.seconds); } else { pc.printf("NMEA has no valid data"); } } }
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
6:f0c13bb7d266 | 2017-03-01 | trevieze | Math error in GPS speed calculation from Knots to Kilometer. Should be ; 1Kn = 1.85Km |
5:c5f700c1e1af | 2017-03-01 | trevieze | Added NEWS indication to Lon and Lat display |
4:7240a18102a6 | 2017-02-18 | trevieze | Added missing seconds in structure |
3:e64b8be9ce92 | 2017-02-17 | trevieze | Tested library with Adafruit GPS data logger and appears to work. |
2:dbc6c0789611 | 2017-02-16 | trevieze | Wrapper for NMEA |
1:4b5ffae743c0 | 2017-02-10 | trevieze | New interrupt service handler for NMEA library |
0:15611c7938a3 | 2010-06-08 | simon | (none) |