 
 // function to be called each iteration to feed the GPS instantiation
 void readGPS() {
-  if (gpsSerial.available()) {
+  while (gpsSerial.available()) {
     gps.encode(gpsSerial.read());
+  }
+}
+
+// Blocking function to read info from ESP
+void readESP() {
+  while (espSerial.available()) {
+    dataModule.print(espSerial.read());
   }
 }
 


// region pin definitions
#define radioIntPin 0
#define gyroIntPin 1
#define buzzerPin 3
#define gyroChipSelect 4
#define radioChipSelect 5
#define sdChipSelect 6
// end region

String getGyroLogString(int16_t * data) {
  return (String(data[0], DEC) + "," + String(data[1], DEC) + "," + String(data[2], DEC) + ",");
}

// Function for returning formatted GPS string
String getGPSLogString() {
  return (String(gps.location.lat(),6) + "," + String(gps.location.lng(),6) + ",");
}

