Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Bicycl_Computer_NUCLEO-F411RE Bicycl_Computer_NUCLEO-L476RG
Fork of GPS by
Homepage
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");
}
}
}
