11/*
22 Set Dynamic Model
33 By: Paul Clark (PaulZC)
4- Date: March 9th , 2020
5-
4+ Date: April 22nd , 2020
5+
66 Based extensively on Example3_GetPosition
77 By: Nathan Seidle
88 SparkFun Electronics
1818 SEA, AIRBORNE1g, AIRBORNE2g, AIRBORNE4g, WRIST, BIKE
1919
2020 Note: Long/lat are large numbers because they are * 10^7. To convert lat/long
21- to something google maps understands simply divide the numbers by 10,000,000. We
21+ to something google maps understands simply divide the numbers by 10,000,000. We
2222 do this so that we don't have to use floating point numbers.
2323
2424 Leave NMEA parsing behind. Now you can simply ask the module for the datums you want!
@@ -47,18 +47,19 @@ void setup()
4747 Serial.begin (115200 );
4848 while (!Serial)
4949 ; // Wait for user to open terminal
50- Serial.println (" SparkFun Ublox Example" );
50+ Serial.println (F ( " SparkFun Ublox Example" ) );
5151
5252 Wire.begin ();
5353
54+ // myGPS.enableDebugging(); // Uncomment this line to enable debug messages
55+
5456 if (myGPS.begin () == false ) // Connect to the Ublox module using Wire port
5557 {
5658 Serial.println (F (" Ublox GPS not detected at default I2C address. Please check wiring. Freezing." ));
5759 while (1 )
5860 ;
5961 }
6062
61- // myGPS.enableDebugging(); // Uncomment this line to enable debug messages
6263 myGPS.setI2COutput (COM_TYPE_UBX); // Set the I2C port to output UBX only (turn off NMEA noise)
6364
6465 // If we are going to change the dynamic platform model, let's do it here.
@@ -67,11 +68,23 @@ void setup()
6768
6869 if (myGPS.setDynamicModel (DYN_MODEL_PORTABLE) == false ) // Set the dynamic model to PORTABLE
6970 {
70- Serial.println (" ***!!! Warning: setDynamicModel failed !!!***" );
71+ Serial.println (F (" ***!!! Warning: setDynamicModel failed !!!***" ));
72+ }
73+ else
74+ {
75+ Serial.println (F (" Dynamic platform model changed successfully!" ));
76+ }
77+
78+ // Let's read the new dynamic model to see if it worked
79+ uint8_t newDynamicModel = myGPS.getDynamicModel ();
80+ if (newDynamicModel == 255 )
81+ {
82+ Serial.println (F (" ***!!! Warning: getDynamicModel failed !!!***" ));
7183 }
7284 else
7385 {
74- Serial.println (" Dynamic platform model changed successfully!" );
86+ Serial.print (F (" The new dynamic model is: " ));
87+ Serial.println (newDynamicModel);
7588 }
7689
7790 // myGPS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR
0 commit comments