Hello,
I am looking to use a Boron 404x and a GPS module to receive GPS cords and send them as an event. I cannot figure out how to work the serial as there is no software serial for the Boron 404x. I used a simple example from Adafruit that used software serial. If someone could explain how to convert software serial into useable serial for the Boron 404x I would really appreciate it. Below is what I currently have:
#define GPS_SERIAL Serial1
#define GPS_BAUD 9600
#define GPS_UPDATE_DELAY 60000
Adafruit_GPS GPS(&GPS_SERIAL);
void setup() {
GPS.begin(GPS_BAUD);
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
delay(1000);
String setup_str = "starting";
Particle.publish("GPS Update", setup_str, PRIVATE);
}
void loop() {
GPS.read();
if (GPS.newNMEAreceived()) {
if (!GPS.parse(GPS.lastNMEA())) // Check if we successfully parsed the NMEA sentence
return;
}
if (GPS.fix) {
float latitude = GPS.latitudeDegrees;
float longitude = GPS.longitudeDegrees;
String fixed = "FIXED";
Particle.publish("GPS Update", fixed, PRIVATE);
String data = "lat: " + String(latitude, 6) + ", lon: " + String(longitude, 6);
Particle.publish("GPS Update", data, PRIVATE);
} else {
String not_fixed = "not fixed";
Particle.publish("GPS Update", not_fixed, PRIVATE);
}
delay(GPS_UPDATE_DELAY);
}