|  | 
| 26 | 26 |  Open the serial monitor at 115200 baud to see the output | 
| 27 | 27 | */ | 
| 28 | 28 | 
 | 
| 29 |  | -#include <Particle.h> | 
| 30 | 29 | #include <Wire.h> //Needed for I2C to GPS | 
| 31 | 30 | 
 | 
| 32 | 31 | #include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_Ublox_GPS | 
| @@ -54,31 +53,31 @@ void setup() | 
| 54 | 53 | 
 | 
| 55 | 54 | void loop() | 
| 56 | 55 | { | 
| 57 |  | -  // Calling getPVT returns true if there actually is a fresh navigation solution available. | 
| 58 |  | -  if (myGPS.getPVT()) | 
| 59 |  | -  { | 
| 60 |  | -  Serial.println(); | 
| 61 |  | -  long latitude = myGPS.getLatitude(); | 
| 62 |  | -  Serial.print(F("Lat: ")); | 
| 63 |  | -  Serial.print(latitude); | 
|  | 56 | + // Calling getPVT returns true if there actually is a fresh navigation solution available. | 
|  | 57 | + if (myGPS.getPVT()) | 
|  | 58 | + { | 
|  | 59 | + Serial.println(); | 
|  | 60 | + long latitude = myGPS.getLatitude(); | 
|  | 61 | + Serial.print(F("Lat: ")); | 
|  | 62 | + Serial.print(latitude); | 
| 64 | 63 | 
 | 
| 65 |  | -  long longitude = myGPS.getLongitude(); | 
| 66 |  | -  Serial.print(F(" Long: ")); | 
| 67 |  | -  Serial.print(longitude); | 
| 68 |  | -  Serial.print(F(" (degrees * 10^-7)")); | 
|  | 64 | + long longitude = myGPS.getLongitude(); | 
|  | 65 | + Serial.print(F(" Long: ")); | 
|  | 66 | + Serial.print(longitude); | 
|  | 67 | + Serial.print(F(" (degrees * 10^-7)")); | 
| 69 | 68 | 
 | 
| 70 |  | -  long altitude = myGPS.getAltitude(); | 
| 71 |  | -  Serial.print(F(" Alt: ")); | 
| 72 |  | -  Serial.print(altitude); | 
| 73 |  | -  Serial.print(F(" (mm)")); | 
|  | 69 | + long altitude = myGPS.getAltitude(); | 
|  | 70 | + Serial.print(F(" Alt: ")); | 
|  | 71 | + Serial.print(altitude); | 
|  | 72 | + Serial.print(F(" (mm)")); | 
| 74 | 73 | 
 | 
| 75 |  | -  byte SIV = myGPS.getSIV(); | 
| 76 |  | -  Serial.print(F(" SIV: ")); | 
| 77 |  | -  Serial.print(SIV); | 
|  | 74 | + byte SIV = myGPS.getSIV(); | 
|  | 75 | + Serial.print(F(" SIV: ")); | 
|  | 76 | + Serial.print(SIV); | 
| 78 | 77 | 
 | 
| 79 |  | -  Serial.println(); | 
| 80 |  | -  } else { | 
| 81 |  | -  Serial.print("."); | 
| 82 |  | -  delay(50); | 
| 83 |  | -  } | 
|  | 78 | + Serial.println(); | 
|  | 79 | + } else { | 
|  | 80 | + Serial.print("."); | 
|  | 81 | + delay(50); | 
|  | 82 | + } | 
| 84 | 83 | } | 
0 commit comments