           return;  // we can fail to parse a sentence in which case we should just wait for another
     }
   
-    // if millis() or timer wraps around, we'll just reset it
+    // If millis() or timer wraps around, we'll just reset it
     if (timer > millis())  timer = millis();
-  
+
+    // Log on an interval
     if (millis() - timer > LOGGING_DELAY) {
         timer = millis(); // reset the timer
         float voltage = 0.0;  // calculated voltage

        current = (((float)currentValue * V_REF) / ADC_STATES - CURRENT_OFFSET) * CURRENT_MULTIPLIER;

        //log_data(latitude, longitude, speed, angle, altitude, voltage, current);
        print_data(latitude, longitude, speed, angle, altitude, voltage, current);
        //print_gps();
    }
}

void log_data(float latitude, float longitude, float speed, float angle, float altitude, float voltage, float current) {
    if (logFile) {
        unsigned long time = millis();
        sprintf(outputBuffer, "%10d, %12.8f, %12.8f, %8.4f, %8.4f, %8.4f, %8.4f, %8.4f", time, latitude, longitude, speed, angle, altitude, voltage, current);
        logFile.println(outputBuffer);
    }
}


Adafruit_GPS *gps;
uint32_t timer = millis();
File logFile;


void setup() {
