I'm using an STM32F103C series board and have been trying and failing to get the NeoGPS library to work on it. I've got it working on an Arduino Nano, and so far I've never had an issue running Arduino Nano code on my STM32, but this one doesn't seem to like it.
Code: Select all
// Description: This program only parses an RMC sentence for the lat/lon.
// When uploading remove Tx line of GPS from Rx of Nano,
// Can print Lat & Long to screen in 1.4mS
#include <NMEAGPS.h>
#define gpsPort Serial
#define GPS_PORT_NAME "Serial"
#define DEBUG_PORT Serial
int32_t Lat, Long;
static NMEAGPS gps; // This parses the GPS characters
void setup()
{
DEBUG_PORT.begin(38400);
while (!DEBUG_PORT);
DEBUG_PORT.println( F("Looking for GPS device on " GPS_PORT_NAME) );
DEBUG_PORT.flush();
gpsPort.begin(38400);
}
void loop(){
//
while (gps.available(gpsPort)) {
gps_fix fix = gps.read();
if (fix.valid.location) {
DEBUG_PORT.print(fix.latitudeL());
DEBUG_PORT.print(", ");
DEBUG_PORT.println(fix.longitudeL());
//DEBUG_PORT.print( fix.speed_mph(), 2 );
}
}
}
If anyone had any ideas I could try or places to look that would be really useful!
Many thanks.