Updated version with new commands and sleep mode

Fork of GPS by Sam Clarke

Committer:
Spilly
Date:
Wed Apr 29 18:09:53 2015 +0000
Revision:
10:a73736c18332
Parent:
9:083f6fe8e4c4
Updated comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Spilly 6:af055728e564 1 /**************************************************************************************************************************************************************
Spilly 6:af055728e564 2 // This is a modified version of mbed /users/SamClarke/code/GPS/ for MTK3339 GPS module
Spilly 6:af055728e564 3 //
Spilly 6:af055728e564 4 // Changes made by Ryan Spillman:
Spilly 7:7aac669b0075 5 //
Spilly 10:a73736c18332 6 // Last updated: 4/29/2015
Spilly 7:7aac669b0075 7 //
Spilly 6:af055728e564 8 // added commands to the initialization function to set baud rate, set update rate, enabled DGPS WAAS, and set minimum navigation speed
Spilly 6:af055728e564 9 // added a function to put the unit into sleep mode
Spilly 6:af055728e564 10 // added several zeros after the decimal places to fix weird rounding errors
Spilly 6:af055728e564 11 // added information about checksums
Spilly 7:7aac669b0075 12 // Modified parse data function to get all of the NMEA sentences at once. Previously it only grabbed one sentence each time the function was called
Spilly 7:7aac669b0075 13 // Changed latitude and longitude calculation variables to doubles to decrease math errors
Spilly 8:2476bea153a1 14 // Added function to get GPGSA NMEA sentence (we have HDOP!)
Spilly 6:af055728e564 15 //
Spilly 6:af055728e564 16 // IMPORTANT:
Spilly 6:af055728e564 17 // Any changes made to commands sent to GPS unit require corresponding changes to the
Spilly 6:af055728e564 18 // checksum at the end of the command
Spilly 6:af055728e564 19 // Here is a tool for calculating the checksum:
Spilly 6:af055728e564 20 // http://siliconsparrow.com/demos/nmeachecksum.php
Spilly 6:af055728e564 21 **************************************************************************************************************************************************************/
Spilly 6:af055728e564 22
SamClarke 1:0a034c2dbea6 23 #include "GPS.h"
SamClarke 1:0a034c2dbea6 24 GPS::GPS(PinName tx, PinName rx) : _UltimateGps(tx, rx)
SamClarke 1:0a034c2dbea6 25 {
Spilly 6:af055728e564 26 //_UltimateGps.baud(9600); //use this for default MTK3339 adafruit firmware
Spilly 6:af055728e564 27 _UltimateGps.baud(38400); //Changed firmware of MTK3339 to 38400 baud with update rate of 5Hz (GlobalTopFlashTool to change firmware)
SamClarke 1:0a034c2dbea6 28 }
Spilly 7:7aac669b0075 29 void GPS::coldStart()
Spilly 7:7aac669b0075 30 {
Spilly 7:7aac669b0075 31 _UltimateGps.printf("$PMTK103*30\r\n");
Spilly 7:7aac669b0075 32 }
Spilly 7:7aac669b0075 33 int GPS::getGPGGA()
Spilly 7:7aac669b0075 34 {
Spilly 7:7aac669b0075 35 if(sscanf(NEMA, "GPGGA, %*f, %*f, %*c, %*f, %*c, %d, %d, %*f, %f", &fixtype, &satellites, &altitude) >=1)
Spilly 7:7aac669b0075 36 {
Spilly 7:7aac669b0075 37 //if(fixtype == 0) return 0;
Spilly 7:7aac669b0075 38 return 1;
Spilly 7:7aac669b0075 39 }
Spilly 7:7aac669b0075 40 return 0;
Spilly 7:7aac669b0075 41 }
Spilly 7:7aac669b0075 42 int GPS::getGPGSA()
Spilly 7:7aac669b0075 43 {
Spilly 7:7aac669b0075 44 if(satellites == 4)
Spilly 7:7aac669b0075 45 {
Spilly 7:7aac669b0075 46 if(sscanf(NEMA, "GPGSA, %c, %d, %*c, %*c, %*c, %*c,,,,,,,,,%f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 47 }
Spilly 7:7aac669b0075 48 else if(satellites == 5)
Spilly 7:7aac669b0075 49 {
Spilly 7:7aac669b0075 50 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d,,,,,,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 51 }
Spilly 7:7aac669b0075 52 else if(satellites == 6)
Spilly 7:7aac669b0075 53 {
Spilly 7:7aac669b0075 54 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d,,,,,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 55 }
Spilly 7:7aac669b0075 56 else if(satellites == 7)
Spilly 7:7aac669b0075 57 {
Spilly 7:7aac669b0075 58 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d,,,,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 59 }
Spilly 7:7aac669b0075 60 else if(satellites == 8)
Spilly 7:7aac669b0075 61 {
Spilly 7:7aac669b0075 62 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d,,,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 63 }
Spilly 7:7aac669b0075 64 else if(satellites == 9)
Spilly 7:7aac669b0075 65 {
Spilly 7:7aac669b0075 66 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d,,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 67 }
Spilly 7:7aac669b0075 68 else if(satellites == 10)
Spilly 7:7aac669b0075 69 {
Spilly 7:7aac669b0075 70 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d,,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 71 }
Spilly 7:7aac669b0075 72 else if(satellites == 11)
Spilly 7:7aac669b0075 73 {
Spilly 7:7aac669b0075 74 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d,, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 75 }
Spilly 7:7aac669b0075 76 else
Spilly 7:7aac669b0075 77 {
Spilly 7:7aac669b0075 78 if(sscanf(NEMA, "GPGSA, %c, %d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %*d, %f, %f, %f", &mode, &status, &PDOP, &HDOP, &VDOP) >=1) return 1;
Spilly 7:7aac669b0075 79 }
Spilly 7:7aac669b0075 80 return 0;
Spilly 7:7aac669b0075 81 }
Spilly 7:7aac669b0075 82 int GPS::getGPRMC()
Spilly 7:7aac669b0075 83 {
Spilly 7:7aac669b0075 84
Spilly 7:7aac669b0075 85 if(sscanf(NEMA, "GPRMC, %2d%2d%f, %c, %f, %c, %f, %c, %f, %f, %2d%2d%2d", &hours, &minutes, &seconds, &validity, &latitude, &ns, &longitude, &ew, &speed, &heading, &day, &month, &year) >=1)
Spilly 7:7aac669b0075 86 {
Spilly 7:7aac669b0075 87 year += 2000;
Spilly 7:7aac669b0075 88 if(ns =='S') {
Spilly 7:7aac669b0075 89 latitude *= -1.00000000000000000f;
Spilly 7:7aac669b0075 90 }
Spilly 7:7aac669b0075 91 if(ew =='W') {
Spilly 7:7aac669b0075 92 longitude *= -1.00000000000000000f;
Spilly 7:7aac669b0075 93 }
Spilly 7:7aac669b0075 94 double degrees = trunc(latitude / 100.0000000000000000f);
Spilly 7:7aac669b0075 95 double minutes = latitude - (degrees * 100.00000000000000000f);
Spilly 7:7aac669b0075 96 degLat = degrees + minutes / 60.00000000000000000f;
Spilly 7:7aac669b0075 97 degrees = trunc(longitude / 100.0000000000000000f);
Spilly 7:7aac669b0075 98 minutes = longitude - (degrees * 100.00000000000000000f);
Spilly 7:7aac669b0075 99 degLon = degrees + minutes / 60.00000000000000000f;
Spilly 7:7aac669b0075 100 if(fixtype == 1) {
Spilly 7:7aac669b0075 101 fix = "Positive";
Spilly 7:7aac669b0075 102 }
Spilly 7:7aac669b0075 103 if(fixtype == 2) {
Spilly 7:7aac669b0075 104 fix = "Differential";
Spilly 7:7aac669b0075 105 }
Spilly 7:7aac669b0075 106 if(heading > 0.00f && heading < 45.00f) {
Spilly 7:7aac669b0075 107 cardinal = "NNE";
Spilly 7:7aac669b0075 108 }
Spilly 7:7aac669b0075 109 if(heading == 45.00f) {
Spilly 7:7aac669b0075 110 cardinal = "NE";
Spilly 7:7aac669b0075 111 }
Spilly 7:7aac669b0075 112 if(heading > 45.00f && heading < 90.00f) {
Spilly 7:7aac669b0075 113 cardinal = "ENE";
Spilly 7:7aac669b0075 114 }
Spilly 7:7aac669b0075 115 if(heading == 90.00f) {
Spilly 7:7aac669b0075 116 cardinal = "E";
Spilly 7:7aac669b0075 117 }
Spilly 7:7aac669b0075 118 if(heading > 90.00f && heading < 135.00f) {
Spilly 7:7aac669b0075 119 cardinal = "ESE";
Spilly 7:7aac669b0075 120 }
Spilly 7:7aac669b0075 121 if(heading == 135.00f) {
Spilly 7:7aac669b0075 122 cardinal = "SE";
Spilly 7:7aac669b0075 123 }
Spilly 7:7aac669b0075 124 if(heading > 135.00f && heading < 180.00f) {
Spilly 7:7aac669b0075 125 cardinal = "SSE";
Spilly 7:7aac669b0075 126 }
Spilly 7:7aac669b0075 127 if(heading == 180.00f) {
Spilly 7:7aac669b0075 128 cardinal = "S";
Spilly 7:7aac669b0075 129 }
Spilly 7:7aac669b0075 130 if(heading > 180.00f && heading < 225.00f) {
Spilly 7:7aac669b0075 131 cardinal = "SSW";
Spilly 7:7aac669b0075 132 }
Spilly 7:7aac669b0075 133 if(heading == 225.00f) {
Spilly 7:7aac669b0075 134 cardinal = "SW";
Spilly 7:7aac669b0075 135 }
Spilly 7:7aac669b0075 136 if(heading > 225.00f && heading < 270.00f) {
Spilly 7:7aac669b0075 137 cardinal = "WSW";
Spilly 7:7aac669b0075 138 }
Spilly 7:7aac669b0075 139 if(heading == 270.00f) {
Spilly 7:7aac669b0075 140 cardinal = "W";
Spilly 7:7aac669b0075 141 }
Spilly 7:7aac669b0075 142 if(heading > 270.00f && heading < 315.00f) {
Spilly 7:7aac669b0075 143 cardinal = "WNW";
Spilly 7:7aac669b0075 144 }
Spilly 7:7aac669b0075 145 if(heading == 315.00f) {
Spilly 7:7aac669b0075 146 cardinal = "NW";
Spilly 7:7aac669b0075 147 }
Spilly 7:7aac669b0075 148 if(heading > 315.00f && heading < 360.00f) {
Spilly 7:7aac669b0075 149 cardinal = "NNW";
Spilly 7:7aac669b0075 150 }
Spilly 7:7aac669b0075 151 if(heading == 360.00f || heading == 0.00f) {
Spilly 7:7aac669b0075 152 cardinal = "N";
Spilly 7:7aac669b0075 153 }
Spilly 7:7aac669b0075 154 kph = speed*1.852f;
Spilly 7:7aac669b0075 155 return 1;
Spilly 7:7aac669b0075 156 }
Spilly 7:7aac669b0075 157 return 0;
Spilly 7:7aac669b0075 158 }
SamClarke 1:0a034c2dbea6 159 int GPS::parseData()
SamClarke 1:0a034c2dbea6 160 {
Spilly 8:2476bea153a1 161 if(getGPGGA())
Spilly 8:2476bea153a1 162 {
Spilly 8:2476bea153a1 163 sentenceCount = sentenceCount + 1;
Spilly 8:2476bea153a1 164 return 1;
Spilly 8:2476bea153a1 165 }
Spilly 8:2476bea153a1 166 else if(getGPRMC())
Spilly 8:2476bea153a1 167 {
Spilly 8:2476bea153a1 168 sentenceCount = sentenceCount + 1;
Spilly 8:2476bea153a1 169 return 1;
Spilly 8:2476bea153a1 170 }
Spilly 8:2476bea153a1 171 else if(getGPGSA())
Spilly 8:2476bea153a1 172 {
Spilly 8:2476bea153a1 173 sentenceCount = sentenceCount + 1;
Spilly 8:2476bea153a1 174 return 1;
Spilly 8:2476bea153a1 175 }
Spilly 8:2476bea153a1 176 return 0;
SamClarke 1:0a034c2dbea6 177 }
SamClarke 1:0a034c2dbea6 178
SamClarke 1:0a034c2dbea6 179
SamClarke 1:0a034c2dbea6 180 float GPS::trunc(float v)
SamClarke 1:0a034c2dbea6 181 {
Spilly 6:af055728e564 182 if(v < 0.0f) {
Spilly 6:af055728e564 183 v*= -1.0f;
SamClarke 1:0a034c2dbea6 184 v = floor(v);
Spilly 6:af055728e564 185 v*=-1.0f;
SamClarke 1:0a034c2dbea6 186 } else {
SamClarke 1:0a034c2dbea6 187 v = floor(v);
SamClarke 1:0a034c2dbea6 188 }
SamClarke 1:0a034c2dbea6 189 return v;
SamClarke 1:0a034c2dbea6 190 }
SamClarke 1:0a034c2dbea6 191
Spilly 8:2476bea153a1 192 bool GPS::getData()
SamClarke 1:0a034c2dbea6 193 {
Spilly 8:2476bea153a1 194 if(!_UltimateGps.readable()) return 0;
Spilly 8:2476bea153a1 195 char tempChar = _UltimateGps.getc();
Spilly 8:2476bea153a1 196 //printf("%c\n", tempChar);
Spilly 8:2476bea153a1 197 if(tempChar == '$')
Spilly 8:2476bea153a1 198 {
Spilly 8:2476bea153a1 199 for(int i=0; i<256; i++)
Spilly 8:2476bea153a1 200 {
Spilly 8:2476bea153a1 201 NEMA[i] = _UltimateGps.getc();
Spilly 8:2476bea153a1 202 if(NEMA[i] == '\r')
Spilly 8:2476bea153a1 203 {
Spilly 8:2476bea153a1 204 NEMA[i] = 0;
Spilly 8:2476bea153a1 205 parseData();
Spilly 8:2476bea153a1 206 if(_UltimateGps.readable())
Spilly 8:2476bea153a1 207 {
Spilly 8:2476bea153a1 208
Spilly 8:2476bea153a1 209 tempChar = _UltimateGps.getc();
Spilly 8:2476bea153a1 210 if(tempChar != '$')
Spilly 8:2476bea153a1 211 {
Spilly 8:2476bea153a1 212 tempChar = _UltimateGps.getc();
Spilly 8:2476bea153a1 213 }
Spilly 8:2476bea153a1 214 if(tempChar == '$')
Spilly 8:2476bea153a1 215 {
Spilly 8:2476bea153a1 216 for(int i=0; i<256; i++)
Spilly 8:2476bea153a1 217 {
Spilly 8:2476bea153a1 218 NEMA[i] = _UltimateGps.getc();
Spilly 8:2476bea153a1 219 if(NEMA[i] == '\r')
Spilly 8:2476bea153a1 220 {
Spilly 8:2476bea153a1 221 NEMA[i] = 0;
Spilly 8:2476bea153a1 222 parseData();
Spilly 8:2476bea153a1 223 if(_UltimateGps.readable())
Spilly 8:2476bea153a1 224 {
Spilly 8:2476bea153a1 225 tempChar = _UltimateGps.getc();
Spilly 8:2476bea153a1 226 if(tempChar != '$')
Spilly 8:2476bea153a1 227 {
Spilly 8:2476bea153a1 228 tempChar = _UltimateGps.getc();
Spilly 8:2476bea153a1 229 }
Spilly 8:2476bea153a1 230 if(tempChar == '$')
Spilly 8:2476bea153a1 231 {
Spilly 8:2476bea153a1 232 for(int i=0; i<256; i++)
Spilly 8:2476bea153a1 233 {
Spilly 8:2476bea153a1 234 NEMA[i] = _UltimateGps.getc();
Spilly 8:2476bea153a1 235 if(NEMA[i] == '\r')
Spilly 8:2476bea153a1 236 {
Spilly 8:2476bea153a1 237 NEMA[i] = 0;
Spilly 8:2476bea153a1 238 parseData();
Spilly 8:2476bea153a1 239 if(sentenceCount == 3)
Spilly 8:2476bea153a1 240 {
Spilly 8:2476bea153a1 241 sentenceCount = 0;
Spilly 8:2476bea153a1 242 return 1;
Spilly 8:2476bea153a1 243 }
Spilly 8:2476bea153a1 244 return 0;
Spilly 8:2476bea153a1 245 }
Spilly 8:2476bea153a1 246 }
Spilly 8:2476bea153a1 247 }
Spilly 8:2476bea153a1 248
Spilly 8:2476bea153a1 249 else
Spilly 8:2476bea153a1 250 {
Spilly 8:2476bea153a1 251 return 0;
Spilly 8:2476bea153a1 252 }
Spilly 8:2476bea153a1 253 }
Spilly 8:2476bea153a1 254 if(sentenceCount == 3)
Spilly 8:2476bea153a1 255 {
Spilly 8:2476bea153a1 256 sentenceCount = 0;
Spilly 8:2476bea153a1 257 return 1;
Spilly 8:2476bea153a1 258 }
Spilly 8:2476bea153a1 259 return 0;
Spilly 8:2476bea153a1 260 }
Spilly 8:2476bea153a1 261 }
Spilly 8:2476bea153a1 262 }
Spilly 8:2476bea153a1 263 }
Spilly 8:2476bea153a1 264 if(sentenceCount == 3)
Spilly 8:2476bea153a1 265 {
Spilly 8:2476bea153a1 266 sentenceCount = 0;
Spilly 8:2476bea153a1 267 return 1;
Spilly 8:2476bea153a1 268 }
Spilly 8:2476bea153a1 269 return 0;
Spilly 8:2476bea153a1 270 }
Spilly 8:2476bea153a1 271 }
Spilly 8:2476bea153a1 272
Spilly 8:2476bea153a1 273 }
Spilly 8:2476bea153a1 274 return 0;
SamClarke 1:0a034c2dbea6 275 }
SamClarke 1:0a034c2dbea6 276
SamClarke 1:0a034c2dbea6 277 void GPS::Init()
SamClarke 1:0a034c2dbea6 278 {
Spilly 7:7aac669b0075 279 //don't need to send baud rate command because it is already set to 38400 in firmware
Spilly 7:7aac669b0075 280 //_UltimateGps.printf("$PMTK251,38400*27\r\n"); //set baud (any higher and the serial buffer overflows)
Spilly 7:7aac669b0075 281
Spilly 7:7aac669b0075 282 //Note: SBAS can only be enabled when update rate is less than or equal to 5Hz.
Spilly 7:7aac669b0075 283 //_UltimateGps.printf("$PMTK220,100*2F\r\n"); //10 Hz update
Spilly 8:2476bea153a1 284 //_UltimateGps.printf("$PMTK220,200*2C\r\n"); //5 Hz udpate
Spilly 8:2476bea153a1 285 _UltimateGps.printf("$PMTK220,1000*1f\r\n"); //1 Hz udpate
Spilly 7:7aac669b0075 286
Spilly 7:7aac669b0075 287 _UltimateGps.printf("$PMTK225,0*2bt\r\n"); //disable always locate (datasheet indicates that this negatively affects accuracy)
Spilly 7:7aac669b0075 288 _UltimateGps.printf("$PMTK301,2*2et\r\n"); //set DGPS to use WAAS
Spilly 7:7aac669b0075 289
Spilly 7:7aac669b0075 290 //_UltimateGps.printf("$PMTK386,0.8*35\r\n"); //set Nav Speed threshold to 0.8 m/s
Spilly 7:7aac669b0075 291 //_UltimateGps.printf("$PMTK386,0.2*3f\r\n"); //set Nav Speed threshold to 0.2 m/s
Spilly 7:7aac669b0075 292 _UltimateGps.printf("$PMTK386,0*23\r\n"); //disable Nav Speed threshold
Spilly 7:7aac669b0075 293
Spilly 7:7aac669b0075 294 //_UltimateGps.printf("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); //GPRMC and GPGGA
Spilly 7:7aac669b0075 295 //_UltimateGps.printf("$PMTK314,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); //GPRMC and GPGSA
Spilly 7:7aac669b0075 296 _UltimateGps.printf("$PMTK314,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); //GPRMC, GPGGA, and GPGSA
Spilly 8:2476bea153a1 297 //_UltimateGps.attach(this, &GPS::GPSInt);
Spilly 6:af055728e564 298 }
Spilly 6:af055728e564 299
Spilly 6:af055728e564 300 void GPS::Sleep(int sleep)
Spilly 6:af055728e564 301 {
Spilly 6:af055728e564 302 if(sleep == 1)
Spilly 6:af055728e564 303 {
Spilly 6:af055728e564 304 _UltimateGps.printf("$$PMTK161,0*28\r\n"); //go to sleep
Spilly 6:af055728e564 305 }
Spilly 6:af055728e564 306 else
Spilly 6:af055728e564 307 {
Spilly 7:7aac669b0075 308 _UltimateGps.printf("$$PMTK161,1*28\r\n"); //wake up
Spilly 7:7aac669b0075 309
Spilly 7:7aac669b0075 310 /*unit goes back to default config when put to sleep*/
Spilly 7:7aac669b0075 311
Spilly 7:7aac669b0075 312 //Note: SBAS can only be enabled when update rate is less than or equal to 5Hz.
Spilly 7:7aac669b0075 313 //_UltimateGps.printf("$PMTK220,100*2F\r\n"); //10 Hz update
Spilly 8:2476bea153a1 314 //_UltimateGps.printf("$PMTK220,200*2C\r\n"); //5 Hz udpate
Spilly 8:2476bea153a1 315 _UltimateGps.printf("$PMTK220,1000*1f\r\n"); //1 Hz udpate
Spilly 7:7aac669b0075 316
Spilly 7:7aac669b0075 317 _UltimateGps.printf("$PMTK225,0*2bt\r\n"); //disable always locate (datasheet indicates that this negatively affects accuracy)
Spilly 7:7aac669b0075 318 _UltimateGps.printf("$PMTK301,2*2et\r\n"); //set DGPS to use WAAS
Spilly 7:7aac669b0075 319
Spilly 7:7aac669b0075 320 //_UltimateGps.printf("$PMTK386,0.8*35\r\n"); //set Nav Speed threshold to 0.8 m/s
Spilly 7:7aac669b0075 321 //_UltimateGps.printf("$PMTK386,0.2*3f\r\n"); //set Nav Speed threshold to 0.2 m/s
Spilly 7:7aac669b0075 322 _UltimateGps.printf("$PMTK386,0*23\r\n"); //disable Nav Speed threshold
Spilly 7:7aac669b0075 323
Spilly 7:7aac669b0075 324 //_UltimateGps.printf("$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); //GPRMC and GPGGA
Spilly 7:7aac669b0075 325 //_UltimateGps.printf("$PMTK314,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n"); //GPRMC and GPGSA
Spilly 7:7aac669b0075 326 _UltimateGps.printf("$PMTK314,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n"); //GPRMC, GPGGA, and GPGSA
Spilly 6:af055728e564 327 }
SamClarke 1:0a034c2dbea6 328 }