From 4b2006754e55e8285b26e6baa699225b7579d078 Mon Sep 17 00:00:00 2001 From: Tony DiCola Date: Thu, 7 Aug 2014 13:08:27 -0700 Subject: [PATCH] Fix #14 by fixing compilation for Arduino Due, and updating due_parsing example text to clarify connections. --- Adafruit_GPS.cpp | 5 ++++- examples/due_parsing/due_parsing.ino | 31 +++++++--------------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Adafruit_GPS.cpp b/Adafruit_GPS.cpp index b87722c..9636a2d 100755 --- a/Adafruit_GPS.cpp +++ b/Adafruit_GPS.cpp @@ -9,7 +9,10 @@ Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, check license.txt for more information All text above must be included in any redistribution ****************************************/ -#include +#ifdef __AVR__ + // Only include software serial on AVR platforms (i.e. not on Due). + #include +#endif #include // how long are max NMEA lines to parse? diff --git a/examples/due_parsing/due_parsing.ino b/examples/due_parsing/due_parsing.ino index a1e9ea5..207c683 100644 --- a/examples/due_parsing/due_parsing.ino +++ b/examples/due_parsing/due_parsing.ino @@ -13,30 +13,13 @@ #include -#ifdef __AVR__ - #include -#endif - -// If you're using a GPS module: -// Connect the GPS Power pin to 5V -// Connect the GPS Ground pin to ground -// 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: +// This sketch is ONLY for the Arduino Due! +// You should make the following connections with the Due and GPS module: +// GPS power pin to Arduino Due 3.3V output. +// GPS ground pin to Arduino Due ground. +// For hardware serial 1 (recommended): +// GPS TX to Arduino Due Serial1 RX pin 19 +// GPS RX to Arduino Due Serial1 TX pin 18 #define mySerial Serial1 Adafruit_GPS GPS(&mySerial);