Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit a86fdc5

Browse files
committed
Fixes print statments, adds returns to functions missing returns
1 parent c009e9e commit a86fdc5

File tree

5 files changed

+50
-43
lines changed

5 files changed

+50
-43
lines changed

examples/Dead Reckoning/Example1_calibrateSensor/Example1_calibrateSensor.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Open the serial monitor at 115200 baud to see the output
1818
1919
To take advantage of the internal IMU of either the Dead Reckoning GPS
20-
boards (ZED-F9R, NEO-M8U), you must first calibrate them. This includes securing the GPS module
20+
boards (ZED-F9R, NEO-M8U), you must first calibrate it. This includes securing the GPS module
2121
to your vehicle so that it is stable within 2 degrees and that the frame of
2222
reference of the board is consistent with the picture outlined in the
2323
Receiver-Description-Prot-Spec Datasheet under Automotive/Untethered Dead
@@ -39,7 +39,7 @@ void setup()
3939
{
4040
Serial.begin(115200);
4141
while (!Serial); //Wait for user to open terminal
42-
Serial.println("SparkFun Ublox Example");
42+
Serial.println(F("SparkFun Ublox Example"));
4343

4444
Wire.begin();
4545

@@ -56,10 +56,10 @@ void loop()
5656
{
5757

5858
if (myGPS.getEsfInfo()){
59-
Serial.print("Fusion Mode: ");
59+
Serial.print(F("Fusion Mode: "));
6060
Serial.println(myGPS.imuMeas.fusionMode);
6161
if (myGPS.imuMeas.fusionMode == 1)
62-
Serial.println("Sensor is calibrated!");
62+
Serial.println(F("Sensor is calibrated!"));
6363
}
6464

6565
delay(250);

examples/Dead Reckoning/Example2_getIMUData/Example2_getIMUData.ino

+11-11
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void setup()
3131
{
3232
Serial.begin(115200);
3333
while (!Serial); //Wait for user to open terminal
34-
Serial.println("SparkFun Ublox Example");
34+
Serial.println(F("SparkFun Ublox Example"));
3535

3636
Wire.begin();
3737

@@ -45,15 +45,15 @@ void setup()
4545

4646
if (myGPS.getEsfInfo()){
4747

48-
Serial.print("Fusion Mode: ");
48+
Serial.print(F("Fusion Mode: "));
4949
Serial.println(myGPS.imuMeas.fusionMode);
5050

5151
if (myGPS.imuMeas.fusionMode == 1){
52-
Serial.println("Fusion Mode is Initialized!");
52+
Serial.println(F("Fusion Mode is Initialized!"));
5353
}
5454
else {
55-
Serial.println("Fusion Mode is either disabled or not initialized - Freezing!");
56-
Serial.println("Please see Example 1 description at top for more information.");
55+
Serial.println(F("Fusion Mode is either disabled or not initialized - Freezing!"));
56+
Serial.println(F("Please see Example 1 description at top for more information."));
5757
}
5858
}
5959
}
@@ -63,17 +63,17 @@ void loop()
6363

6464
if (myGPS.getEsfIns())
6565
{
66-
Serial.print("X: ");
66+
Serial.print(F("X: "));
6767
Serial.println(myGPS.imuMeas.xAngRate);
68-
Serial.print("Y: ");
68+
Serial.print(F("Y: "));
6969
Serial.println(myGPS.imuMeas.yAngRate);
70-
Serial.print("Z: ");
70+
Serial.print(F("Z: "));
7171
Serial.println(myGPS.imuMeas.zAngRate);
72-
Serial.print("X Acceleration: ");
72+
Serial.print(F("X Acceleration: "));
7373
Serial.println(myGPS.imuMeas.xAccel);
74-
Serial.print("Y Acceleration: ");
74+
Serial.print(F("Y Acceleration: "));
7575
Serial.println(myGPS.imuMeas.yAccel);
76-
Serial.print("Z Acceleration: ");
76+
Serial.print(F("Z Acceleration: "));
7777
Serial.println(myGPS.imuMeas.zAccel);
7878
// These values also have "validity checks" that can be provided by the
7979
// ublox library, add "Vald" to values: e.g. xAngRateVald or xAccelVald.

examples/Dead Reckoning/Example3_getSensorStatus/Example3_getSensorStatus.ino

+14-14
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void setup()
3535
{
3636
Serial.begin(115200);
3737
while (!Serial); //Wait for user to open terminal
38-
Serial.println("SparkFun Ublox Example");
38+
Serial.println(F("SparkFun Ublox Example"));
3939

4040
Wire.begin();
4141

@@ -52,15 +52,15 @@ void setup()
5252
// speed sensor attached to the module.
5353
if (myGPS.getEsfInfo()){
5454

55-
Serial.print("Fusion Mode: ");
55+
Serial.print(F("Fusion Mode: "));
5656
Serial.println(myGPS.imuMeas.fusionMode);
5757

5858
if (myGPS.imuMeas.fusionMode == 1){
59-
Serial.println("Fusion Mode is Initialized!");
59+
Serial.println(F("Fusion Mode is Initialized!"));
6060
}
6161
else {
62-
Serial.println("Fusion Mode is either disabled or not initialized - Freezing!");
63-
Serial.println("Please see Example 1 description at top for more information.");
62+
Serial.println(F("Fusion Mode is either disabled or not initialized - Freezing!"));
63+
Serial.println(F("Please see Example 1 description at top for more information."));
6464
}
6565
}
6666
}
@@ -70,25 +70,25 @@ void loop()
7070

7171
for(int i=1; i<=myGPS.ubloxSen.numSens; i++){
7272
myGPS.getSensState(i); // Give the sensor you want to check on.
73-
Serial.print("Sensor Data Type: "); //See ublox receiver description
73+
Serial.print(F("Sensor Data Type: ")); //See ublox receiver description
7474
//or our hookup guide for information on the
7575
//return value.
7676
Serial.println(myGPS.ubloxSen.senType);
77-
Serial.print("Being Used: ");
77+
Serial.print(F("Being Used: "));
7878
Serial.println(myGPS.ubloxSen.isUsed);
79-
Serial.print("Is Ready: ");
79+
Serial.print(F("Is Ready: "));
8080
Serial.println(myGPS.ubloxSen.isReady);
81-
Serial.print("Calibration Status: ");
81+
Serial.print(F("Calibration Status: "));
8282
Serial.println(myGPS.ubloxSen.calibStatus);
83-
Serial.print("Time Status: ");
83+
Serial.print(F("Time Status: "));
8484
Serial.println(myGPS.ubloxSen.timeStatus);
85-
Serial.print("Bad Measure: ");
85+
Serial.print(F("Bad Measure: "));
8686
Serial.println(myGPS.ubloxSen.timeStatus);
87-
Serial.print("Bad Time Tag: ");
87+
Serial.print(F("Bad Time Tag: "));
8888
Serial.println(myGPS.ubloxSen.badTag);
89-
Serial.print("Missed Measure : ");
89+
Serial.print(F("Missed Measure : "));
9090
Serial.println(myGPS.ubloxSen.missMeas);
91-
Serial.print("Noisy Measure: ");
91+
Serial.print(F("Noisy Measure: "));
9292
Serial.println(myGPS.ubloxSen.noisyMeas);
9393
}
9494

examples/Dead Reckoning/Example4_vehicleDynamics/Example4_vehicleDynamics.ino

+13-11
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void setup()
3333
{
3434
Serial.begin(115200);
3535
while (!Serial); //Wait for user to open terminal
36-
Serial.println("SparkFun Ublox Example");
36+
Serial.println(F("SparkFun Ublox Example"));
3737

3838
Wire.begin();
3939

@@ -47,34 +47,36 @@ void setup()
4747

4848
if (myGPS.getEsfInfo()){
4949

50-
Serial.print("Fusion Mode: ");
50+
Serial.print(F("Fusion Mode: "));
5151
Serial.println(myGPS.imuMeas.fusionMode);
5252

5353
if (myGPS.imuMeas.fusionMode == 1){
54-
Serial.println("Fusion Mode is Initialized!");
54+
Serial.println(F("Fusion Mode is Initialized!"));
5555
}
5656
else {
57-
Serial.println("Fusion Mode is either disabled or not initialized - Freezing!");
58-
Serial.println("Please see Example 1 description at top for more information.");
57+
Serial.println(F("Fusion Mode is either disabled or not initialized - Freezing!"));
58+
Serial.println(F("Please see Example 1 description at top for more information."));
5959
}
6060
}
6161
}
6262

6363
void loop()
6464
{
6565
myGPS.getVehAtt(); // Give the sensor you want to check on.
66-
Serial.print("Roll: ");
66+
Serial.print(F("Roll: "));
6767
Serial.println(myGPS.vehAtt.roll);
68-
Serial.print("Pitch: ");
68+
Serial.print(F("Pitch: "));
6969
Serial.println(myGPS.vehAtt.pitch);
70-
Serial.print("Heading: ");
70+
Serial.print(F("Heading: "));
7171
Serial.println(myGPS.vehAtt.heading);
72-
Serial.print("Roll Accuracy: ");
72+
Serial.print(F("Roll Accuracy: "));
7373
Serial.println(myGPS.vehAtt.accRoll);
74-
Serial.print("Pitch Accuracy: ");
74+
Serial.print(F("Pitch Accuracy: "));
7575
Serial.println(myGPS.vehAtt.accPitch);
76-
Serial.print("Heading Accuracy: ");
76+
Serial.print(F("Heading Accuracy: "));
7777
Serial.println(myGPS.vehAtt.accHeading);
78+
79+
delay(250);
7880
}
7981

8082

src/SparkFun_Ublox_Arduino_Library.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -3219,6 +3219,8 @@ boolean SFE_UBLOX_GPS::getEsfIns(uint16_t maxWait)
32193219
imuMeas.xAccel = extractLong(24); // m/s
32203220
imuMeas.yAccel = extractLong(28); // m/s
32213221
imuMeas.zAccel = extractLong(32); // m/s
3222+
3223+
return(true);
32223224
}
32233225

32243226
//
@@ -3257,6 +3259,8 @@ boolean SFE_UBLOX_GPS::getEsfDataInfo(uint16_t maxWait)
32573259

32583260
}
32593261

3262+
return(true);
3263+
32603264
}
32613265

32623266
boolean SFE_UBLOX_GPS::getEsfRawDataInfo(uint16_t maxWait)
@@ -3279,6 +3283,7 @@ boolean SFE_UBLOX_GPS::getEsfRawDataInfo(uint16_t maxWait)
32793283
imuMeas.rawData = (bitField && 0xFFFFFF);
32803284
imuMeas.rawTStamp = extractLong(8);
32813285

3286+
return(true);
32823287
}
32833288

32843289
sfe_ublox_status_e SFE_UBLOX_GPS::getSensState(uint8_t sensor, uint16_t maxWait)
@@ -3295,7 +3300,7 @@ sfe_ublox_status_e SFE_UBLOX_GPS::getSensState(uint8_t sensor, uint16_t maxWait)
32953300
ubloxSen.numSens = extractByte(15);
32963301

32973302
if (sensor > ubloxSen.numSens)
3298-
return SFE_UBLOX_STATUS_OUT_OF_RANGE;
3303+
return (SFE_UBLOX_STATUS_OUT_OF_RANGE);
32993304

33003305
checkUblox();
33013306

@@ -3322,7 +3327,7 @@ sfe_ublox_status_e SFE_UBLOX_GPS::getSensState(uint8_t sensor, uint16_t maxWait)
33223327
ubloxSen.noisyMeas = (sensorFieldThr && 0x08) >> 3;
33233328
}
33243329

3325-
return SFE_UBLOX_STATUS_SUCCESS;
3330+
return (SFE_UBLOX_STATUS_SUCCESS);
33263331

33273332
}
33283333

@@ -3346,6 +3351,6 @@ boolean SFE_UBLOX_GPS::getVehAtt(uint16_t maxWait){
33463351
vehAtt.accPitch = extractLong(24);
33473352
vehAtt.accHeading = extractLong(28);
33483353

3349-
return true;
3354+
return (true);
33503355

33513356
}

0 commit comments

Comments
 (0)