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
Copy file name to clipboardExpand all lines: examples/Data_Logging/DataLoggingExample4_RXM_without_Callbacks/DataLoggingExample4_RXM_without_Callbacks.ino
+6-9
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,7 @@
35
35
Insert a formatted micro-SD card into the socket on the Carrier Board.
36
36
Connect the Carrier Board to your computer using a USB-C cable.
37
37
Ensure you have the SparkFun Apollo3 boards installed: http://boardsmanager/All#SparkFun_Apollo3
38
-
This code has been tested using version 2.1.0 of the Apollo3 boards on Arduino IDE 1.8.13.
39
-
- Version 2.1.1 of Apollo3 contains a feature which makes I2C communication with u-blox modules problematic
40
-
- We recommend using v2.1.0 of Apollo3 until v2.2.0 is released
38
+
This code has been tested using version 2.2.0 of the Apollo3 boards on Arduino IDE 1.8.13.
41
39
Select "Artemis MicroMod Processor" as the board type.
42
40
Press upload to upload the code onto the Artemis.
43
41
Open the Serial Monitor at 115200 baud to see the output.
@@ -77,6 +75,7 @@ File myFile; //File that all GNSS data is written to
77
75
78
76
#definesdWriteSize512// Write data to the SD card in blocks of 512 bytes
79
77
#definefileBufferSize16384// Allocate 16KBytes of RAM for UBX message storage
78
+
uint8_t *myBuffer; // A buffer to hold the data while we write it to SD card
80
79
81
80
unsignedlong lastPrint; // Record when the last Serial print took place
82
81
unsignedlong bytesWritten = 0; // Record how many bytes have been written to SD card
@@ -181,6 +180,8 @@ void setup()
181
180
182
181
myGNSS.logRXMRAWX(); // Enable RXM RAWX data logging
183
182
183
+
myBuffer = newuint8_t[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
184
+
184
185
Serial.println(F("Press any key to stop logging."));
185
186
186
187
lastPrint = millis(); // Initialize lastPrint
@@ -198,9 +199,7 @@ void loop()
198
199
{
199
200
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card
200
201
201
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
202
-
203
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
202
+
myGNSS.extractFileBufferData(myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
204
203
205
204
myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card
206
205
@@ -242,15 +241,13 @@ void loop()
242
241
{
243
242
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN while we write to the SD card
244
243
245
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
246
-
247
244
uint16_t bytesToWrite = remainingBytes; // Write the remaining bytes to SD card sdWriteSize bytes at a time
248
245
if (bytesToWrite > sdWriteSize)
249
246
{
250
247
bytesToWrite = sdWriteSize;
251
248
}
252
249
253
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
250
+
myGNSS.extractFileBufferData(myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
254
251
255
252
myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card
Copy file name to clipboardExpand all lines: examples/Data_Logging/DataLoggingExample5_Fast_RXM/DataLoggingExample5_Fast_RXM.ino
+6-9
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,7 @@
35
35
Insert a formatted micro-SD card into the socket on the Carrier Board.
36
36
Connect the Carrier Board to your computer using a USB-C cable.
37
37
Ensure you have the SparkFun Apollo3 boards installed: http://boardsmanager/All#SparkFun_Apollo3
38
-
This code has been tested using version 2.1.0 of the Apollo3 boards on Arduino IDE 1.8.13.
39
-
- Version 2.1.1 of Apollo3 contains a feature which makes I2C communication with u-blox modules problematic
40
-
- We recommend using v2.1.0 of Apollo3 until v2.2.0 is released
38
+
This code has been tested using version 2.2.0 of the Apollo3 boards on Arduino IDE 1.8.13.
41
39
Select "Artemis MicroMod Processor" as the board type.
42
40
Press upload to upload the code onto the Artemis.
43
41
Open the Serial Monitor at 115200 baud to see the output.
@@ -77,6 +75,7 @@ File myFile; //File that all GNSS data is written to
77
75
78
76
#definesdWriteSize512// Write data to the SD card in blocks of 512 bytes
79
77
#definefileBufferSize32768// Allocate 32KBytes of RAM for UBX message storage
78
+
uint8_t *myBuffer; // A buffer to hold the data while we write it to SD card
80
79
81
80
unsignedlong lastPrint; // Record when the last Serial print took place
82
81
unsignedlong bytesWritten = 0; // Record how many bytes have been written to SD card
@@ -196,6 +195,8 @@ void setup()
196
195
197
196
myGNSS.logRXMRAWX(); // Enable RXM RAWX data logging
198
197
198
+
myBuffer = newuint8_t[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
199
+
199
200
Serial.println(F("Press any key to stop logging."));
200
201
201
202
lastPrint = millis(); // Initialize lastPrint
@@ -213,9 +214,7 @@ void loop()
213
214
{
214
215
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card
215
216
216
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
217
-
218
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
217
+
myGNSS.extractFileBufferData(myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
219
218
220
219
myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card
221
220
@@ -263,15 +262,13 @@ void loop()
263
262
{
264
263
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN while we write to the SD card
265
264
266
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
267
-
268
265
uint16_t bytesToWrite = remainingBytes; // Write the remaining bytes to SD card sdWriteSize bytes at a time
269
266
if (bytesToWrite > sdWriteSize)
270
267
{
271
268
bytesToWrite = sdWriteSize;
272
269
}
273
270
274
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
271
+
myGNSS.extractFileBufferData(myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
275
272
276
273
myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card
Copy file name to clipboardExpand all lines: examples/Data_Logging/DataLoggingExample6_NMEA/DataLoggingExample6_NMEA.ino
+6-9
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,7 @@
24
24
Insert a formatted micro-SD card into the socket on the Carrier Board.
25
25
Connect the Carrier Board to your computer using a USB-C cable.
26
26
Ensure you have the SparkFun Apollo3 boards installed: http://boardsmanager/All#SparkFun_Apollo3
27
-
This code has been tested using version 2.1.0 of the Apollo3 boards on Arduino IDE 1.8.13.
28
-
- Version 2.1.1 of Apollo3 contains a feature which makes I2C communication with u-blox modules problematic
29
-
- We recommend using v2.1.0 of Apollo3 until v2.2.0 is released
27
+
This code has been tested using version 2.2.0 of the Apollo3 boards on Arduino IDE 1.8.13.
30
28
Select "Artemis MicroMod Processor" as the board type.
31
29
Press upload to upload the code onto the Artemis.
32
30
Open the Serial Monitor at 115200 baud to see the output.
@@ -68,6 +66,7 @@ File myFile; //File that all GNSS data is written to
68
66
69
67
#definesdWriteSize512// Write data to the SD card in blocks of 512 bytes
70
68
#definefileBufferSize16384// Allocate 16KBytes of RAM for UBX message storage
69
+
uint8_t *myBuffer; // A buffer to hold the data while we write it to SD card
71
70
72
71
unsignedlong lastPrint; // Record when the last Serial print took place
73
72
unsignedlong bytesWritten = 0; // Record how many bytes have been written to SD card
@@ -175,6 +174,8 @@ void setup()
175
174
myGNSS.setNMEALoggingMask(SFE_UBLOX_FILTER_NMEA_ALL); // Enable logging of all enabled NMEA messages
176
175
//myGNSS.setNMEALoggingMask(SFE_UBLOX_FILTER_NMEA_GGA | SFE_UBLOX_FILTER_NMEA_GSA); // Or we can, for example, log only GxGGA & GxGSA and ignore GxGSV
177
176
177
+
myBuffer = newuint8_t[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
178
+
178
179
Serial.println(F("Press any key to stop logging."));
179
180
180
181
lastPrint = millis(); // Initialize lastPrint
@@ -192,9 +193,7 @@ void loop()
192
193
{
193
194
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN each time we write to the SD card
194
195
195
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
196
-
197
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
196
+
myGNSS.extractFileBufferData(myBuffer, sdWriteSize); // Extract exactly sdWriteSize bytes from the UBX file buffer and put them into myBuffer
198
197
199
198
myFile.write(myBuffer, sdWriteSize); // Write exactly sdWriteSize bytes from myBuffer to the ubxDataFile on the SD card
200
199
@@ -236,15 +235,13 @@ void loop()
236
235
{
237
236
digitalWrite(LED_BUILTIN, HIGH); // Flash LED_BUILTIN while we write to the SD card
238
237
239
-
uint8_t myBuffer[sdWriteSize]; // Create our own buffer to hold the data while we write it to SD card
240
-
241
238
uint16_t bytesToWrite = remainingBytes; // Write the remaining bytes to SD card sdWriteSize bytes at a time
242
239
if (bytesToWrite > sdWriteSize)
243
240
{
244
241
bytesToWrite = sdWriteSize;
245
242
}
246
243
247
-
myGNSS.extractFileBufferData((uint8_t *)&myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
244
+
myGNSS.extractFileBufferData(myBuffer, bytesToWrite); // Extract bytesToWrite bytes from the UBX file buffer and put them into myBuffer
248
245
249
246
myFile.write(myBuffer, bytesToWrite); // Write bytesToWrite bytes from myBuffer to the ubxDataFile on the SD card
0 commit comments