Fix #14 by fixing compilation for Arduino Due, and updating due_parsing example text to clarify connections.

This commit is contained in:
Tony DiCola 2014-08-07 13:08:27 -07:00
parent 11cb409ead
commit 4b2006754e
2 changed files with 11 additions and 25 deletions

View File

@ -9,7 +9,10 @@ Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information BSD license, check license.txt for more information
All text above must be included in any redistribution All text above must be included in any redistribution
****************************************/ ****************************************/
#include <SoftwareSerial.h> #ifdef __AVR__
// Only include software serial on AVR platforms (i.e. not on Due).
#include <SoftwareSerial.h>
#endif
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
// how long are max NMEA lines to parse? // how long are max NMEA lines to parse?

View File

@ -13,30 +13,13 @@
#include <Adafruit_GPS.h> #include <Adafruit_GPS.h>
#ifdef __AVR__ // This sketch is ONLY for the Arduino Due!
#include <SoftwareSerial.h> // You should make the following connections with the Due and GPS module:
#endif // GPS power pin to Arduino Due 3.3V output.
// GPS ground pin to Arduino Due ground.
// If you're using a GPS module: // For hardware serial 1 (recommended):
// Connect the GPS Power pin to 5V // GPS TX to Arduino Due Serial1 RX pin 19
// Connect the GPS Ground pin to ground // GPS RX to Arduino Due Serial1 TX pin 18
// If using software serial (sketch example default):
// Connect the GPS TX (transmit) pin to Digital 3
// Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
// Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
// Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3
// If you're using the Adafruit GPS shield, change
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
// and make sure the switch is set to SoftSerial
// If using software serial, keep this line enabled
// (you can change the pin numbers to match your wiring):
//SoftwareSerial mySerial(3, 2);
// If using hardware serial (e.g. Arduino Mega, Leonardo, Due), comment
// out the above line and enable this line instead:
#define mySerial Serial1 #define mySerial Serial1
Adafruit_GPS GPS(&mySerial); Adafruit_GPS GPS(&mySerial);