clarified parsing example for MEGA users
following the instructions in the comments while using a MEGA was wrong: * "comment out the above six lines" - no six lines to comment out. * mySerial was called on line 83 when requesting firmware version, and would not have been instantiated if using just "Adafruit_GPS GPS(&Serial1);"
This commit is contained in:
parent
5f0415ee68
commit
b68f93f742
|
|
@ -28,14 +28,18 @@
|
||||||
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
|
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
|
||||||
// and make sure the switch is set to SoftSerial
|
// and make sure the switch is set to SoftSerial
|
||||||
|
|
||||||
// If using software serial, keep these lines enabled
|
// If using software serial, keep this line enabled
|
||||||
// (you can change the pin numbers to match your wiring):
|
// (you can change the pin numbers to match your wiring):
|
||||||
SoftwareSerial mySerial(3, 2);
|
SoftwareSerial mySerial(3, 2);
|
||||||
|
|
||||||
|
// If using hardware serial (e.g. Arduino Mega), comment out the
|
||||||
|
// above SoftwareSerial line, and enable this line instead
|
||||||
|
// (you can change the Serial number to match your wiring):
|
||||||
|
|
||||||
|
//HardwareSerial mySerial = Serial1;
|
||||||
|
|
||||||
|
|
||||||
Adafruit_GPS GPS(&mySerial);
|
Adafruit_GPS GPS(&mySerial);
|
||||||
// If using hardware serial (e.g. Arduino Mega), comment
|
|
||||||
// out the above six lines and enable this line instead:
|
|
||||||
//Adafruit_GPS GPS(&Serial1);
|
|
||||||
|
|
||||||
|
|
||||||
// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
|
// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
|
||||||
|
|
@ -164,4 +168,4 @@ void loop() // run over and over again
|
||||||
Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
|
Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue