Hi All,
I am using a PMODGPS with an Arduino Mega, to make a follow me robot. I have a transmitter code and receiver code using the NeoGPS library. We're almost done with the integration of the whole project, but I would like to somehow increase the update rate of the both GPS receivers. By default, they're at 1 hz and this works fine, but its not as reliable. I tried looking online and I found neogps code to update rate for Ublox, but not for any other general GPS. I'm not too good at this so I'm not really sure how to go along with this.
I'm using ultrasonic sensors and an XBee, but I don't think that's relevant to what I'm asking. I thought I'd give out as much information so get people started.
If anyone could help me increase the update rate of the GPS from 1 Hz to anything above that (max 10Hz) that would be great.
High Regards
Transmitter code:
#include <NMEAGPS.h>
NMEAGPS gps;
gps_fix fix;
#define gpsPort Serial1
void setup()
{
Serial.begin(9600);
gpsPort.begin( 9600 );
gps.send_P( &gpsPort, F("PMTK220,200") ); //set update rate to 5Hz set update rate to 5Hz (added this while trying various
//codes)
// Might be needed:
//
// #define RSTpin 37 //pin 37, JE-08
// pinMode(RST, OUTPUT);
// digitalWrite(RST, LOW);
}
void loop()
{
if (gps.available( gpsPort ))
{
fix = gps.read();
if (fix.valid.satellites)
{
Serial.print( fix.satellites );
}
Serial.print(',');
if (fix.valid.location)
Serial.print( fix.latitude(), 6 );
Serial.print(',');
if (fix.valid.location)
Serial.print( fix.longitude(), 6 );
Serial.println();
}
}
I'll post the receiver code in the next post as I've exceeded the char limit.