You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: examples/ZED-F9P/Example9_multiSetVal/Example9_multiSetVal.ino
+20-19
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
/*
2
-
Send UBX binary commands to enable RTCM sentences on Ublox ZED-F9P module
2
+
Send UBX binary commands to enable RTCM sentences on u-blox ZED-F9P module
3
3
Based on Example7 By: Nathan Seidle
4
4
SparkFun Electronics
5
5
Updated by Paul Clark to demonstrate setVal8/16/32, newCfgValset8/16/32, addCfgValset8/16/32 and sendCfgValset8/16/32
6
6
Date: July 1st, 2019
7
7
License: MIT. See license file for more information but you can
8
8
basically do whatever you want with this code.
9
9
10
-
Ublox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
10
+
u-blox changed how to configure their modules in 2019. As of version 23 of the UBX protocol the
11
11
UBX-CFG commands are deprecated; they still work, they just recommend using VALSET, VALGET, and VALDEL
12
12
commands instead. This example shows how to use this new command structure.
13
13
@@ -31,16 +31,18 @@ SFE_UBLOX_GPS myGPS;
31
31
voidsetup()
32
32
{
33
33
Serial.begin(115200);
34
-
while (!Serial); //Wait for user to open terminal
35
-
Serial.println("Ublox multi setVal example");
34
+
while (!Serial)
35
+
; //Wait for user to open terminal
36
+
Serial.println("u-blox multi setVal example");
36
37
37
38
Wire.begin();
38
39
Wire.setClock(400000); //Increase I2C clock speed to 400kHz
39
40
40
-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
41
+
if (myGPS.begin() == false) //Connect to the u-blox module using Wire port
41
42
{
42
-
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
43
-
while (1);
43
+
Serial.println(F("u-blox GPS not detected at default I2C address. Please check wiring. Freezing."));
44
+
while (1)
45
+
;
44
46
}
45
47
46
48
myGPS.enableDebugging(); //Enable debug messages over Serial (default)
@@ -55,25 +57,25 @@ void setup()
55
57
//U2, I2, E2 and X2 values are 16-bit
56
58
//U4, I4, R4, E4, X4 values are 32-bit
57
59
58
-
setValueSuccess &= myGPS.setVal8(0x10930006, 0); //Enable high precision NMEA (value is 8-bit (L / U1))
59
-
//setValueSuccess &= myGPS.setVal16(0x30210001, 200); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2))
60
-
//setValueSuccess &= myGPS.setVal16(0x30210001, 200, 1); //Set rate setting in RAM instead of BBR
61
-
setValueSuccess &= myGPS.setVal16(0x30210001, 1000); //Set measurement rate to 1000ms (1Hz update rate) (value is 16-bit (U2))
60
+
setValueSuccess &= myGPS.setVal8(UBLOX_CFG_NMEA_HIGHPREC, 0); //Enable high precision NMEA (value is 8-bit (L / U1))
61
+
//setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 200); //Set measurement rate to 100ms (10Hz update rate) (value is 16-bit (U2))
62
+
//setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 200, 1); //Set rate setting in RAM instead of BBR
63
+
setValueSuccess &= myGPS.setVal16(UBLOX_CFG_RATE_MEAS, 1000); //Set measurement rate to 1000ms (1Hz update rate) (value is 16-bit (U2))
62
64
63
65
//Below is the original way we enabled a single RTCM message on the I2C port. After that, we show how to do the same
64
66
//but with multiple messages all in one go using newCfgValset, addCfgValset and sendCfgValset.
65
67
//Original: myGPS.enableRTCMmessage(UBX_RTCM_1005, COM_PORT_I2C, 1); //Enable message 1005 to output through I2C port, message every second
66
68
67
69
//Begin with newCfgValset8/16/32
68
-
setValueSuccess &= myGPS.newCfgValset8(0x209102bd, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1))
69
-
//setValueSuccess &= myGPS.newCfgValset8(0x209102bd, 1, 7); //Set this and the following settings into Flash/RAM/BBR instead of BBR
70
+
setValueSuccess &= myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); //Set output rate of msg 1005 over the I2C port to once per measurement (value is 8-bit (U1))
71
+
//setValueSuccess &= myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, 7); //Set this and the following settings into Flash/RAM/BBR instead of BBR
70
72
//Add extra keyIDs and values using addCfgValset8/16/32
71
-
setValueSuccess &= myGPS.addCfgValset8(0x209102cc, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1))
72
-
setValueSuccess &= myGPS.addCfgValset8(0x209102d1, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1))
73
-
setValueSuccess &= myGPS.addCfgValset8(0x209102d6, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1))
74
-
setValueSuccess &= myGPS.addCfgValset8(0x20910318, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1))
73
+
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1077_I2C, 1); //Set output rate of msg 1077 over the I2C port to once per measurement (value is 8-bit (U1))
74
+
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1087_I2C, 1); //Set output rate of msg 1087 over the I2C port to once per measurement (value is 8-bit (U1))
75
+
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1127_I2C, 1); //Set output rate of msg 1127 over the I2C port to once per measurement (value is 8-bit (U1))
76
+
setValueSuccess &= myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1); //Set output rate of msg 1097 over the I2C port to once per measurement (value is 8-bit (U1))
75
77
// Add the final value and send the packet using sendCfgValset8/16/32
76
-
setValueSuccess &= myGPS.sendCfgValset8(0x20910303, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1))
78
+
setValueSuccess &= myGPS.sendCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); //Set output rate of msg 1230 over the I2C port to once every 10 measurements (value is 8-bit (U1))
0 commit comments