My LoRaWAN Signal Mapping MSc summer project. This is a copy of the actual repository with personal information removed.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LoRaWAN-Signal-Mapping/iot/main/gps.cpp

27 lines
534 B

#include "gps.h"
#include "settings.h"
void gps_begin() {
serial_gps.begin(BAUD_GPS);
}
TinyGPSLocation gps_location() {
Serial.print("[gps] Getting location: ");
while(serial_gps.available() > 0) {
if(!gps.encode(serial_gps.read()))
continue;
if(!gps.location.isValid() || gis.location.isUpdated()) {
Serial.print(".");
delay(100);
continue;
}
Serial.println("ok");
return gps.location;
}
}
void gps_end() {
Serial.println(F("[warning] Putting the GPS device to sleep isn't implemented yet."));
}