Main Menu

search

You are here

GPS Software

[last updated: 2022-03-20]
go to: GPS module
go to: hiking tracker
go to: Arduino code
-----

  • Adafruit_GPS:
    • Output format:
      • from Adafruit documentation:
        "Despite appearances, the location data is NOT in decimal degrees.
        It is in degrees and minutes in the following format:
        Latitude: DDMM.MMMM (The first two characters are the degrees.)
        Longitude: DDDMM.MMMM (The first three characters are the degrees.)"
      • Example code to print out location looks like this:
        Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
        GPS.longitude is printed as the numeric longitude, in DDDMM.MMMM format
        This is 3-digit degrees, 2-digit minutes, decimal point, 4 (or more) digits of fractional minutes.
        GPS.lon is the letter (E or W) identifying the location quadrant

        Similarly for latitude, GPS.latitude format is DDMM.MMMM
        and GPS.lat prints out N or S for quadrant identifier

      • Convert lat & lng to DD.DDDD format:
        • Latitude Arduino code:
            float lat1 = GPS.latitude;
            int lat1_deg = floor(lat1/100);
            float lat1_min = (lat1/100 - lat1_deg) * 100;
            float lat1_minDecDeg = lat1_min / 60;
            float latDeg = lat1_deg + lat1_minDecDeg;
        • Longitude Arduino code:
            float lng1 = GPS.longitude;
            int lng1_deg = floor(lng1/100);
            float lng1_min = (lng1/100 - lng1_deg) * 100;
            float lng1_minDecDeg = lng1_min / 60;
            float lngDeg = lng1_deg + lng1_minDecDeg;

      ----------------------------------------------------

    • NeoGPS:

    .

    .

    .

    eof