GPS Shield - SD data function incorrect data returned

Information and discussion regarding Firewing shields

GPS Shield - SD data function incorrect data returned

Postby bitfogav » Wed May 08, 2013 11:06 pm

I'm running the GPS Shield with the Sample code progGPS.bas and for some reason the following code that writes to the SD Card seems to write random ######## to the SD Card .CSV file.

Code: Select all
' write the date...
Gps.GetField(rmc, 8, data)
SD.Write(FormatDate(data), ",")


Just to see if it was an error ive added the code a second time like the following below

Code: Select all
            ' get the speed - if the first speed character is greater
            ' than zero then open the file and record the event... 
            Gps.GetField(rmc, 6, speed)
            if speed(0) <> "0" and SD.Append(filename) = errOK then
                               
                  ' write the date...
                  Gps.GetField(rmc, 8, data)
                  SD.Write(FormatDate(data), ",")
               
                  ' write the time...
                  Gps.GetField(rmc, 0, data)
                  SD.Write(FormatTime(data), ",")
                   
                  ' write the date a second time...
                  Gps.GetField(rmc, 8, data)
                  SD.Write(FormatDate(data), ",")
               
                  ' write lat and long...   
                  SD.Write(lat, ",", lng, ",")
               
                  ' now write the speed...
                  SD.Write(speed)
            end if


The code above outputs the following to the SD Card, as you can see the Date shows as #######, anyone have any ideas what is causing this?.

exampleCSV.jpg
exampleCSV.jpg (40.07 KiB) Viewed 27874 times
User avatar
bitfogav
 
Posts: 75
Joined: Sat Nov 17, 2012 11:46 am
Location: UK

Re: GPS Shield - SD data function incorrect data returned

Postby David John Barker » Thu May 09, 2013 8:29 am

The shield is working correctly. You need to increase the column width of the data in Excel, else it will just display "###". For more information, see

http://spreadsheets.about.com/od/formulatips/qt/numbersign_err.htm

if you drag and drop the *.csv file into notepad, you will see that all data is present and correct.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: GPS Shield - SD data function incorrect data returned

Postby bitfogav » Thu May 09, 2013 3:27 pm

Thanks David that was the problem, Suppose thats what you get for never using Excel before!..

exampleCSV2.jpg
Resized the Columns
exampleCSV2.jpg (46.11 KiB) Viewed 27863 times
User avatar
bitfogav
 
Posts: 75
Joined: Sat Nov 17, 2012 11:46 am
Location: UK

Re: GPS Shield - SD data function incorrect data returned

Postby David John Barker » Thu May 09, 2013 7:41 pm

I guess it is a rather strange output if you have not used Excel before. Don't forget, a *.csv file is just a text file containing comma delimited lines, so it's easy to view in notepad or write your own program to parse the file. Anyway, I hope you are having fun with the GPS shield! If you have not already checked it out, then take a look here:

http://www.firewing.info/pmwiki.php?n=FirewingUser.GPSShield

which shows you how to display the GPS output saved to the SD card on Google Earth.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: GPS Shield - SD data function incorrect data returned

Postby bitfogav » Thu May 09, 2013 7:56 pm

David John Barker wrote: Anyway, I hope you are having fun with the GPS shield! If you have not already checked it out, then take a look here:

http://www.firewing.info/pmwiki.php?n=FirewingUser.GPSShield

which shows you how to display the GPS output saved to the SD card on Google Earth.


David thats one of the reasons why I brought the GPS shield ;) Going to have lots of fun with this!.
User avatar
bitfogav
 
Posts: 75
Joined: Sat Nov 17, 2012 11:46 am
Location: UK


Return to Shields

Who is online

Users browsing this forum: No registered users and 2 guests

x