Updated software serial pull rate
This commit is contained in:
parent
5e48c293bf
commit
6cd65f0a8f
10
collar.ino
10
collar.ino
|
@ -44,12 +44,15 @@ void loop() {
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ss.available() > 0)
|
||||||
|
gps.encode(ss.read());
|
||||||
|
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
if (currentMillis - previousMillis >= interval) {
|
if (currentMillis - previousMillis >= interval) {
|
||||||
previousMillis = currentMillis;
|
previousMillis = currentMillis;
|
||||||
|
|
||||||
// Gather GPS data
|
// Gather GPS data
|
||||||
if (gps.encode(ss.read()) && gps.location.isValid()) {
|
if (gps.location.isValid()) {
|
||||||
Serial.println("Valid GPS");
|
Serial.println("Valid GPS");
|
||||||
lat = gps.location.lat();
|
lat = gps.location.lat();
|
||||||
lng = gps.location.lng();
|
lng = gps.location.lng();
|
||||||
|
@ -70,13 +73,10 @@ void loop() {
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
Serial.println("Failed to encode");
|
Serial.println("Failed to encode");
|
||||||
} else {
|
|
||||||
Serial.print("Status: ");
|
|
||||||
Serial.println(status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.print("Sending packet Lat / Long: ");
|
Serial.print("Sending packet Lat / Long: ");
|
||||||
Serial.print(lat);
|
Serial.println(lat);
|
||||||
Serial.println(lng);
|
Serial.println(lng);
|
||||||
|
|
||||||
// send packet
|
// send packet
|
||||||
|
|
Loading…
Reference in New Issue
Block a user