Closed vigilantmarine closed 1 year ago
Hi. This library might not be suitable for MKR485 Shield. I suggest you try the TinyGPS++ library. Then, you can write something like this:
#include <P1AM.h>
#include <ArduinoRS485.h>
#include <TinyGPS++.h>
TinyGPSPlus gps;
void setup() {
Serial.begin(9600);
while (!Serial);
RS485.begin(4800);
RS485.receive();
}
void loop() {
while (RS485.available()) {
gps.encode(RS485.read());
}
if (gps.altitude.isUpdated()) {
Serial.print("LAT="); Serial.println(gps.location.lat(), 6);
Serial.print("LONG="); Serial.println(gps.location.lng(), 6);
Serial.print("ALT="); Serial.println(gps.altitude.meters());
}
}
Worked perfect! Thank you very much.
I'm trying to use your arduino-nmea-parser-v2 for a project on a P1AM-100 ProOpen by AutomationDirect. It is Arduino based and I have the MKR485 Shield plugged on to it. I can't use a GPS shield since my system will be isolated and not have access to the sky. Standard GARMIN 19X HVS GPS running at 4800.
I've not been able to figure out how have your program read from the RS485 port on the shield. Do you have a suggestion? I'm looking to get the LON, LAT information, and would like to get the TIME & DATE information also so that I can send that information to an HMI for viewing and logging.
Below is the 'Simple' program from NMEA0183-Master, and it reads in the data just fine. Unfortunately, it doesn't have a parsing routine to pull out the LON, LAT, and TIME/DATE into variables that can be used.
Can you help?
include
include
//#include
include
// matches Adafruit GPS logger shield //SoftwareSerial gps(8, 7); NMEA0183 nmea;
void setup() { while (!Serial); Serial.begin(9600); RS485.begin(4800); RS485.receive(); Serial.println("NMEA0183 parser test"); }
void loop() { if (RS485.available()) { char c = RS485.read(); if (nmea.update(c)) { Serial.print("NMEA0183 sentence accepted ("); Serial.print(nmea.getFields()); Serial.print(" fields): "); Serial.write(nmea.getSentence()); Serial.println(); } } }