Hi All!
I am trying to do something very basic (probably!) but can't see to be able to do it :S !
All I want is to output the Latitude and Longitude from my lassen iQ GPS, using the TinyGPS library, to the serial port (eventually I'll output it to a different port as it will be sent to the radio).
The code i'm using is below:
#include "TinyGPS.h"
TinyGPS gps;
long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;
void setup() {
Serial.begin(4800);
}
void loop()
{
// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);
// time in hhmmsscc, date in ddmmyy
gps.get_datetime(&date, &time, &fix_age);
// returns speed in 100ths of a knot
speed = gps.speed();
// course in 100ths of a degree
course = gps.course();
Serial.println(THIS IS WHERE I WANT TO PRINT LAT & LONG!)
}
Where the Serial.println is, that is where I want to be able to say "Lat: _______, Long: ______".
Can someone please help me out!
Thanks
I've tried the example library but not reading anything on serial monitor :S. I haven't got anything hooked up to pin 3 (tx on nss). If I need something attached to pin 3 where do I hook the other end up to?! Thanks
Hi cuddykid! Have you solved this problem? Is everything working? I'm currently setting up Lassen IQ with Arduino Duemilanove and could really use a helping hand..
Nope, haven't found a solution!! Its really annoying me and I'm desperately trying to find an answer because I'm sure this tinygps library was meant to make things easy!!
Keep me posted if you make a breakthrough, and I'll keep you posted if I do!
Thanks
I'm doing similar GPS project and although a novice in Arduino S/W land I am going to be a bit cheeky and share a few thoughts for you to consider:
are you sure the speed and course variables have received the GPS data? Beginner me would try running the code in debug mode and look at them to be sure they have actual data
I'm pretty sure the speed and course variables will need to be text format before serial.print will output them. If they're not in text format (look at them in debug mode) they'll need to be converted
to compose a line like LAT: xxx LONG: YYY requires four parts be either joined together or output one by one. If you do the latter only the last part should be done with serial.println (because the "ln" causes the line to end a new line to start). The first three parts would be done with just serial.print.
Now hopefully an Arduino expert or three will improve/correct my suggestion and help us both...