Skip to content

Commit 0995a67

Browse files
committed
Change speed units to kph (from knots)
1 parent 6f23793 commit 0995a67

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

examples/GPSLocation/GPSLocation.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void loop() {
3939

4040
Serial.print("Ground speed: ");
4141
Serial.print(GPS.speed());
42-
Serial.println(" knots");
42+
Serial.println(" km/h");
4343

4444
Serial.print("Number of satellites: ");
4545
Serial.println(GPS.satellites());

src/GPS.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ float GPSClass::longitude()
9595

9696
float GPSClass::speed()
9797
{
98-
return _speed;
98+
// convert speed from knots to kph
99+
return _speed * 1.852;
99100
}
100101

101102
float GPSClass::course()

src/GPS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GPSClass {
3434

3535
float latitude();
3636
float longitude();
37-
float speed(); // Speed over the ground in knots
37+
float speed(); // Speed over the ground in kph
3838
float course(); // Track angle in degrees
3939
float variation(); // Magnetic Variation
4040
float altitude();

0 commit comments

Comments
 (0)