If the GPS is reporting ‘S’ (that we are in the Southern Hemisphere), you need to make your latitude number negative. If the GPS is reporting ‘N’, leave the number positive. We now have a nice decimal number, deg, which is the decimal representation of our Latitude. So, lets assume x = 3051.8007, our Latitude from the GPS. Adding degWhole to degDec gives you deg, your final answer. The variable deg will hold the final answer, degWhole holds the whole part of the number, and degDec whole the part to the right of the decimal. First create three variables deg, degWhole, and degDec. In order to parse this in Arduino using just numbers I do the following. The latitude data we get from the parsed data from the Adafruit GPS looks like this:įrom lesson 24, we know that this represents 30 degrees and 51.8007 minutes. To explain this, I will give an example for Latitude, and Longitude will work in a similar manner. Since it is tedious to manipulate strings in Arduino, we are going to try and parse the data using numbers and math, not strings. The NMEA sentence would be easy to parse in Python, because Python is so good at easily manipulating strings. The challenge here is that the Arduino is very poor at parsing strings. Lesson 24 explained in great detail how to interpret the NMEA sentences. That is, delimit with commas as shown above, but then use one white space to delimit between successive lines of data. I find it works to not use a line ending, but put a single white space after the Altitude. We have to save the data as:ĭecimal Longitude, Decimal latitude, Altitude In order for this to work, we have to save the data in the manner a KML file wants to see. In this lesson we want to create a data file that we can display as a track in Google Earth. Displaying Data from Adafruit Ultimate GPS as track on Google Earth The problem, though, we did not really do any fine tuning of the data file we were creating. This software correctly reads data from the GPS and then logs the data into two data files on the SD card. We will start with the software that we used in Lesson 23. When you get your gear gathered up, you will be ready to get this project going. First, hook the GPS and Card Reader up as we did in Lesson 23. If you are going to be doing a lot of mobile work, it is probably worth it to invest in a good 9v Rechargable battery system. In this series of lessons we are using the Arduino, Adafruit Ultimate GPS, Virtuabotix SD card reader, and a Battery Clip to power the arduino during your mobile jaunts. You will need to complete those lessons before undertaking this lesson. This lesson builds on Lesson 22, Lesson 23 and Lesson 24. In this lesson we will learn how to take the data we are logging from our GPS, and display it properly on Google Earth.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |