-
Notifications
You must be signed in to change notification settings - Fork 14
/
gpsTime_Location.ino
31 lines (29 loc) · 941 Bytes
/
gpsTime_Location.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <Arduino.h>
#include <MAGELLAN_SIM7600E_MQTT.h>
MAGELLAN_SIM7600E_MQTT magel;
void setup()
{
Serial.begin(115200);
magel.begin();
}
void loop()
{
magel.loop();
magel.interval(5, [](){
if(magel.gps.available())
{
Serial.println("# location Information ====================");
Serial.println("Location: "+ magel.gps.readLocation());
Serial.println("Latitude: "+ String(magel.gps.readLatitude(), 4));
Serial.println("Longitude: "+ String(magel.gps.readLongitude(), 4));
Serial.println("Altitude: "+ String(magel.gps.readAltitude()));
Serial.println("Speed: "+ String(magel.gps.readSpeed()));
Serial.println("Course: "+ String(magel.gps.readCourse()));
Serial.println("\n# Time Information ========================");
Serial.println("getUnixTime: "+ String(magel.gps.getUnixTime()));
}
else{
Serial.println(F("GPS not ready."));
}
});
}