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.h

35 lines
890 B

#pragma once
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#include "settings.h"
// The GPS message decoder
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial serial_gps(PIN_GPS_RX, PIN_GPS_TX);
/**
* Initialises the connection to the GPS device.
*/
void gps_begin();
/**
* Fetches the current location from the GPS device.
* May take a moment, as the GPS device needs time to acquire a satellite fix.
* @return TinyGPSLocation The current location.
*/
TinyGPSLocation gps_location();
/**
* Ends the connection to the GPS device and puts it to sleep in order to save
* power.
* Note that the GPS device is connected directly to the power management
* system and so doesn't get turned off after each measurement, as it takes
* ~30s to reacquire a lock when it first starts up - hence why we put it to
* sleep instead.
*/
void gps_end();