Hello
Sorry for my very bad english (and thanks to google translation!) ... I'm french! ...
I want to make a GPS laptimer to know my lap time on a track, record my track in an SD card and later in kml format.
In my system I use a DUE arduino a UP501 GPS module (10Hz) connected on the serial1 of the arduino, an OLED screen 128 * 64 2.42 '' ssd1309 and a module for SD card to record my GPS data.
I'm trying to use the NeoGPS lib GitHub - SlashDevin/NeoGPS: NMEA and ublox GPS parser for Arduino, configurable to use as few as 10 bytes of RAM and I have a problem with it! I got to run the example NMEA.ino, now I would like to do the NMEA_isr.ino example to do NMEASDlog.ino next
#include <NMEAGPS.h>
//======================================================================
// Program: NMEA_isr.ino
//
// Prerequisites:
// 1) NMEA.ino works with your device
//
// Description: This minimal program parses the GPS data during the
// RX character interrupt. The ISR passes the character to
// the GPS object for parsing. The GPS object will add gps_fix
// structures to a buffer that can be later read() by loop().
//
// License:
// Copyright (C) 2014-2017, SlashDevin
//
// This file is part of NeoGPS
//
// NeoGPS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// NeoGPS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with NeoGPS. If not, see <http://www.gnu.org/licenses/>.
//
//======================================================================
#include <GPSport.h>
#include <Streamers.h>
// Check configuration
#ifndef NMEAGPS_INTERRUPT_PROCESSING
#error You must define NMEAGPS_INTERRUPT_PROCESSING in NMEAGPS_cfg.h!
#endif
static NMEAGPS gps;
//--------------------------
static void GPSisr( uint8_t c )
{
gps.handle( c );
} // GPSisr
//--------------------------
void setup()
{
DEBUG_PORT.begin(9600);
while (!DEBUG_PORT)
;
DEBUG_PORT.print( F("NMEA_isr.INO: started\n") );
DEBUG_PORT.print( F("fix object size = ") );
DEBUG_PORT.println( sizeof(gps.fix()) );
DEBUG_PORT.print( F("NMEAGPS object size = ") );
DEBUG_PORT.println( sizeof(gps) );
DEBUG_PORT.println( F("Looking for GPS device on " GPS_PORT_NAME) );
trace_header( DEBUG_PORT );
DEBUG_PORT.flush();
gpsPort.attachInterrupt( GPSisr );
gpsPort.begin( 9600 );
}
//--------------------------
void loop()
{
if (gps.available()) {
// Print all the things!
trace_all( DEBUG_PORT, gps, gps.read() );
}
if (gps.overrun()) {
gps.overrun( false );
DEBUG_PORT.println( F("DATA OVERRUN: took too long to print GPS data!") );
}
}
If I understood correctly I configured NMEAGPS_cfg.h and GPSport.h as described below.
When I compile NMEA_irs.ino in Arduino IDE 1.8.4 I have this error:
Arduino : 1.8.6 (Windows 7), Carte : "Arduino Due (Programming Port)"
In file included from C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino:34:0:
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino: In function 'void setup()':
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\src/GPSport.h:74:33: error: 'NeoSerial' was not declared in this scope
#define DEBUG_PORT NeoSerial
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino:58:3: note: in expansion of macro 'DEBUG_PORT'
DEBUG_PORT.begin(9600);
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\src/GPSport.h:72:30: error: 'NeoSerial1' was not declared in this scope
#define gpsPort NeoSerial1
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino:73:3: note: in expansion of macro 'gpsPort'
gpsPort.attachInterrupt( GPSisr );
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino: In function 'void loop()':
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\src/GPSport.h:74:33: error: 'NeoSerial' was not declared in this scope
#define DEBUG_PORT NeoSerial
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino:83:16: note: in expansion of macro 'DEBUG_PORT'
trace_all( DEBUG_PORT, gps, gps.read() );
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\src/GPSport.h:74:33: error: 'NeoSerial' was not declared in this scope
#define DEBUG_PORT NeoSerial
^
C:\Users\Musique\Documents\Arduino\libraries\NeoGPS-4.2.9\examples\NMEA_isr\NMEA_isr.ino:88:5: note: in expansion of macro 'DEBUG_PORT'
DEBUG_PORT.println( F("DATA OVERRUN: took too long to print GPS data!") );
^
exit status 1
Erreur de compilation pour la carte Arduino Due (Programming Port)
Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.
my NeoGPS and NeoHWSerial directories are in:
C:\Users\Music\Documents\Arduino\libraries\NeoGPS-4.2.9...
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial.cpp
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial.h
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial_private.h
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial0.cpp
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial1.cpp
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial2.cpp
C:\Users\Music\Documents\Arduino\libraries\NeoHWSerial\NeoHWSerial3.cpp
I'm sorry but I am a beginner in C, C ++ and Arduino!, can you help me find my mistake?
In passing, a big thank you to all those who contribute with their lib and example to us, beginner, to make us progress! thank you so much!
NMEAGPS_cfg.h (13.5 KB)
GPSport.h (10.5 KB)