Skip to content

Commit ba04655

Browse files
committed
Changed GPSBaud type to unsigned long in the examples in case someone uses a value like 38400 which exceeds the size of an integer.
1 parent fe91bf8 commit ba04655

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

examples/DeviceExample/DeviceExample.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
77
*/
88
static const int RXPin = 4, TXPin = 3;
9-
static const int GPSBaud = 4800;
9+
static const unsigned long GPSBaud = 4800;
1010

1111
// The TinyGPS++ object
1212
TinyGPSPlus gps;

examples/FullExample/FullExample.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
77
*/
88
static const int RXPin = 4, TXPin = 3;
9-
static const int GPSBaud = 4800;
9+
static const unsigned long GPSBaud = 4800;
1010

1111
// The TinyGPS++ object
1212
TinyGPSPlus gps;
@@ -156,4 +156,4 @@ static void printStr(const char *str, int len)
156156
for (int i=0; i<len; ++i)
157157
Serial.print(i<slen ? str[i] : ' ');
158158
smartDelay(0);
159-
}
159+
}

examples/KitchenSink/KitchenSink.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
77
*/
88
static const int RXPin = 4, TXPin = 3;
9-
static const int GPSBaud = 4800;
9+
static const unsigned long GPSBaud = 4800;
1010

1111
// The TinyGPS++ object
1212
TinyGPSPlus gps;
@@ -85,7 +85,7 @@ void loop()
8585

8686
else if (gps.speed.isUpdated())
8787
{
88-
Serial.print(F("SPEED Fix Age="));
88+
Serial.print(F("SPEED Fix Age=%ulms Raw=%ul Knots=%f MPH=%f m/s=%f km/h=%f"));
8989
Serial.print(gps.speed.age());
9090
Serial.print(F("ms Raw="));
9191
Serial.print(gps.speed.value());
@@ -184,4 +184,4 @@ void loop()
184184
last = millis();
185185
Serial.println();
186186
}
187-
}
187+
}

examples/SatElevTracker/SatElevTracker.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
4800-baud serial GPS device hooked up on pins 4(RX) and 3(TX).
1111
*/
1212
static const int RXPin = 4, TXPin = 3;
13-
static const int GPSBaud = 4800;
13+
static const unsigned long GPSBaud = 4800;
1414
static const int MAX_SATELLITES = 40;
1515
static const int PAGE_LENGTH = 40;
1616

@@ -147,4 +147,4 @@ void printHeader()
147147
for (int i=0; i<MAX_SATELLITES; ++i)
148148
Serial.print(F("----"));
149149
Serial.println();
150-
}
150+
}

examples/SatelliteTracker/SatelliteTracker.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
4800-baud serial GPS device hooked up on pins 4(RX) and 3(TX).
1515
*/
1616
static const int RXPin = 4, TXPin = 3;
17-
static const int GPSBaud = 4800;
17+
static const unsigned long GPSBaud = 4800;
1818

1919
// The TinyGPS++ object
2020
TinyGPSPlus gps;
@@ -146,4 +146,4 @@ void loop()
146146
}
147147
}
148148
}
149-
}
149+
}

examples/UsingCustomFields/UsingCustomFields.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
4800-baud serial GPS device hooked up on pins 4(RX) and 3(TX).
1313
*/
1414
static const int RXPin = 4, TXPin = 3;
15-
static const int GPSBaud = 4800;
15+
static const unsigned long GPSBaud = 4800;
1616

1717
// The TinyGPS++ object
1818
TinyGPSPlus gps;

0 commit comments

Comments
 (0)