NMEA library and GPRMC

Hi:

I downloaded the NMEA library from maartenlamers.com and attached the file "nmea.h" to my environment.

These are the first two lines of my code, and were on maarten's website as an example

#include <nmea.h>

NMEA gps(GPRMC);

When I try to compile the code, i get the error message:

sketch_nov19b:3: error: 'NMEA' does not name a type, with the heading 'NMEA' does not name a type

what is the problem, and how can I get the environment to recognize the gps(GPRMC) string

Thanks in advance,

:slight_smile:

You'll have to provide a link to the library if you want us to look at it.

How did you "attached the file "nmea.h" to my environment.". That doesn't really even make sense.

Hi:

I'm in Gr. 10 and new to Arduino. I'm having some trouble with the NMEA library.
Here is the link to maarten lamer's site with the examples

http://www.maartenlamers.com/nmea/examples/gprmc_position.txt

i have also attached my file.

Thanks for your help

GPS.ino (561 Bytes)

I searched, since you didn't provide a link, for "nmea library arduino".
First hit:
http://www.maartenlamers.com/nmea/
which contains this note:

Arduino Users

This library was developed for Wiring boards, the more powerful predecessor of Arduino. I do not have an Arduino board, so I could not test it, but I heard reports that Arduino's do not have enough memory. It runs fine on Wiring boards.
Based on my NMEA library, Mikal Hart created TinyGPS for Arduino. It does not contain the "distance_to" and "course_to" functions, however.

You don't have a Wiring board, do you?

Downloading the library anyway, and installing it in the proper place, the code in your link still fails to compile, because the library is NOT compatible with 1.0+ versions of the IDE.

Changing WConstants.h and WProgram.h in the header and source files to Arduino.h does allow the sketch to compile.

Your code, on the other hand won't compile. Even when you fix the obvious errors, you aren't writing math equations here. To determine if a value is in a range, you need to do two completely disjoint tests, not one combined test:

if(x > 0 && x < 500)
{
}

is correct.

if(0 < x < 500)
{
}

is NOT.