I am using a programme developed by Jeremy Blum (SD Card presentation No 15), using an Arduino Mega 2560 using the recommended Serial3, and whileSD and Serial links have been established, it is proving impossible for me to get the gps data uploaded to either the serial monitor (see below, red) or the SD card (see below, green).
My GPS is a HAB supplies UBlox 7, and the programme script is attached (I hope).
I am no programmer (not yet!) and would be delighted to find that I have made a silly mistake, and wouldn't be bothered in the least to be told as much.
Best wishes,
Colin.
"
Serial Screen printout
Testing TinyGPS library v. 12
by Mikal Hart
Sizeof(gpsobject) = 115
Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
(deg) (deg) Age Age (m) --- from GPS ---- ---- to London ---- RX RX Fail
Can you see the raw GPS data without using the TinyGPS library? Try using the second example in serial input basics
If that shows sensible data you will at least know it is being received properly.
There are a few parts in the code you have posted which I would not have - for example this is a strange arrangment when you look at the code in feedgps().
// Every second we print an update
while (millis() - start < 1000)
{
if (feedgps())
newdata = true;
}
Also I'm not sure why there are other calls to the feedgps() function.
Also I'm not sure why there are other calls to the feedgps() function.
Aaaaargh! This has caused so many problems for people! Rather than cooperatively access the fire hose of GPS data, this routine is a kludge to try to process the input buffer at the same time as blocking print statements. Sigh.
Beginners will use print statements as if they don't affect the rest of the program. If there were a way (for everyone) to hook to the GPS serial interrupt, then GPS parsing could happen in the background. Instead, the Arduino staggers like a zombie through each iteration of loop(), hoping that no GPS data is lost while a Serial.print is doing its thing. The Adafruit library optionally hooks to a timer interrupt to do background processing for this very reason.
Unfortunately, this example has propagated in the relative vacuum of GPS parsing libraries. The core part of the library is decent and has served many people, but the examples... aaaargh!
I have posted several times about this problem. Here's one. This is why I wrote NeoGPS, among other reasons. My example programs show how to coordinate the incoming GPS stream with other tasks, like printing or writing to an SD. And for the alternative Cosa platform, there are examples that hook to the Serial interrupt, which avoids the whole foreground processing dance.
But to answer the Original Post:
@colin1: Read this, use code tags, show or describe the wiring, do what Robin2 said, and if you changed anything in Blum's code, post it in code tags.