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

Commit b76e9a9

Browse files
authored
Merge pull request #86 from sparkfun/Example_updates
Example updates
2 parents 48105d3 + 00852c1 commit b76e9a9

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

examples/Example17_Geofence/Example17_Geofence.ino

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void setup()
5050
Serial.println();
5151

5252
delay(1000); // Let the GPS power up
53-
53+
5454
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
5555
{
5656
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
@@ -64,7 +64,7 @@ void setup()
6464

6565
byte fixType = 0;
6666

67-
while (fixType != 3)
67+
while (fixType < 3)
6868
{
6969
fixType = myGPS.getFixType(); // Get the fix type
7070
Serial.print(F("Fix: ")); // Print it
@@ -74,6 +74,7 @@ void setup()
7474
else if(fixType == 2) Serial.print(F(" = 2D"));
7575
else if(fixType == 3) Serial.print(F(" = 3D"));
7676
else if(fixType == 4) Serial.print(F(" = GNSS + Dead reckoning"));
77+
else if(fixType == 5) Serial.print(F(" = Time only"));
7778
Serial.println();
7879
delay(1000);
7980
}
@@ -89,7 +90,7 @@ void setup()
8990
Serial.println(longitude);
9091

9192
uint32_t radius = 500; // Set the radius to 5m (radius is in m * 10^-2 i.e. cm)
92-
93+
9394
byte confidence = 2; // Set the confidence level: 0=none, 1=68%, 2=95%, 3=99.7%, 4=99.99%
9495

9596
// Call clearGeofences() to clear all existing geofences.
@@ -99,18 +100,18 @@ void setup()
99100
// It is possible to define up to four geofences.
100101
// Call addGeofence up to four times to define them.
101102
Serial.println(F("Setting the geofences:"));
102-
103+
103104
Serial.print(F("addGeofence for geofence 1 returned: "));
104105
Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence));
105-
106+
106107
radius = 1000; // 10m
107108
Serial.print(F("addGeofence for geofence 2 returned: "));
108109
Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence));
109-
110+
110111
radius = 1500; // 15m
111112
Serial.print(F("addGeofence for geofence 3 returned: "));
112113
Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence));
113-
114+
114115
radius = 2000; // 20m
115116
Serial.print(F("addGeofence for geofence 4 returned: "));
116117
Serial.println(myGPS.addGeofence(latitude, longitude, radius, confidence));
@@ -130,16 +131,16 @@ void loop()
130131
Serial.println(F(".")); // Tidy up
131132
return; // and go round the loop again
132133
}
133-
134+
134135
Serial.print(F(". status is: ")); // Print the status
135136
Serial.print(currentGeofenceState.status);
136-
137+
137138
Serial.print(F(". numFences is: ")); // Print the numFences
138139
Serial.print(currentGeofenceState.numFences);
139-
140+
140141
Serial.print(F(". combState is: ")); // Print the combined state
141142
Serial.print(currentGeofenceState.combState);
142-
143+
143144
if (currentGeofenceState.combState == 0)
144145
{
145146
Serial.print(F(" = Unknown"));
@@ -163,6 +164,6 @@ void loop()
163164
Serial.print(currentGeofenceState.states[i]);
164165
}
165166
Serial.println();
166-
167+
167168
delay(1000);
168169
}

examples/ZED-F9P/Example2_ValConfigurationMethod/Example2_ValConfigurationMethod.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ void setup()
4646
}
4747

4848
byte response;
49-
response = myGPS.getVal(VAL_GROUP_I2C, VAL_ID_I2C_ADDRESS, VAL_GROUP_I2C_SIZE, VAL_LAYER_RAM);
49+
response = myGPS.getVal8(VAL_GROUP_I2C, VAL_ID_I2C_ADDRESS, VAL_GROUP_I2C_SIZE, VAL_LAYER_RAM);
5050
Serial.print(F("I2C Address: 0x"));
5151
Serial.println(response >> 1, HEX); //We have to shift by 1 to get the common '7-bit' I2C address format
5252

53-
response = myGPS.getVal(VAL_GROUP_I2COUTPROT, VAL_ID_I2COUTPROT_NMEA, VAL_GROUP_I2COUTPROT_SIZE, VAL_LAYER_RAM);
53+
response = myGPS.getVal8(VAL_GROUP_I2COUTPROT, VAL_ID_I2COUTPROT_NMEA, VAL_GROUP_I2COUTPROT_SIZE, VAL_LAYER_RAM);
5454
Serial.print(F("Output NMEA over I2C port: 0x"));
5555
Serial.print(response, HEX);
5656
}

0 commit comments

Comments
 (0)