1
1
/*
2
2
Set Dynamic Model
3
3
By: Paul Clark (PaulZC)
4
- Date: March 9th , 2020
5
-
4
+ Date: April 22nd , 2020
5
+
6
6
Based extensively on Example3_GetPosition
7
7
By: Nathan Seidle
8
8
SparkFun Electronics
18
18
SEA, AIRBORNE1g, AIRBORNE2g, AIRBORNE4g, WRIST, BIKE
19
19
20
20
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
22
22
do this so that we don't have to use floating point numbers.
23
23
24
24
Leave NMEA parsing behind. Now you can simply ask the module for the datums you want!
@@ -47,18 +47,19 @@ void setup()
47
47
Serial.begin (115200 );
48
48
while (!Serial)
49
49
; // Wait for user to open terminal
50
- Serial.println (" SparkFun Ublox Example" );
50
+ Serial.println (F ( " SparkFun Ublox Example" ) );
51
51
52
52
Wire.begin ();
53
53
54
+ // myGPS.enableDebugging(); // Uncomment this line to enable debug messages
55
+
54
56
if (myGPS.begin () == false ) // Connect to the Ublox module using Wire port
55
57
{
56
58
Serial.println (F (" Ublox GPS not detected at default I2C address. Please check wiring. Freezing." ));
57
59
while (1 )
58
60
;
59
61
}
60
62
61
- // myGPS.enableDebugging(); // Uncomment this line to enable debug messages
62
63
myGPS.setI2COutput (COM_TYPE_UBX); // Set the I2C port to output UBX only (turn off NMEA noise)
63
64
64
65
// If we are going to change the dynamic platform model, let's do it here.
@@ -67,11 +68,23 @@ void setup()
67
68
68
69
if (myGPS.setDynamicModel (DYN_MODEL_PORTABLE) == false ) // Set the dynamic model to PORTABLE
69
70
{
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 !!!***" ));
71
83
}
72
84
else
73
85
{
74
- Serial.println (" Dynamic platform model changed successfully!" );
86
+ Serial.print (F (" The new dynamic model is: " ));
87
+ Serial.println (newDynamicModel);
75
88
}
76
89
77
90
// myGPS.saveConfigSelective(VAL_CFG_SUBSEC_NAVCONF); //Uncomment this line to save only the NAV settings to flash and BBR
0 commit comments