diff --git a/circuitpython/code/main.py b/circuitpython/code/main.py index dd49c4f..70a661e 100644 --- a/circuitpython/code/main.py +++ b/circuitpython/code/main.py @@ -63,6 +63,7 @@ import neopixel ########## # config # ########## + print_data_flag = True # Print data on USB UART / REPL output ? send_json_flag = True # Send data as JSON on second UART ? backup_data_flag = True # Write data as CSV files on onboard SPI Flash ? @@ -114,19 +115,21 @@ class Data: self._gps_current_fix = int(time.monotonic()) if gps.has_fix: self._gps_last_fix = self._gps_current_fix - self.data['GPS']['time'] = TIME_FORMAT.format(gps.timestamp_utc.tm_year, - gps.timestamp_utc.tm_mon, - gps.timestamp_utc.tm_mday, - gps.timestamp_utc.tm_hour, - gps.timestamp_utc.tm_min, - gps.timestamp_utc.tm_sec) + self.data['GPS']['time'] = TIME_FORMAT.format( + gps.timestamp_utc.tm_year, + gps.timestamp_utc.tm_mon, + gps.timestamp_utc.tm_mday, + gps.timestamp_utc.tm_hour, + gps.timestamp_utc.tm_min, + gps.timestamp_utc.tm_sec) self.data['GPS']['lat'] = gps.latitude self.data['GPS']['lon'] = gps.longitude self.data['GPS']['alt'] = gps.altitude_m self.data['GPS']['qual'] = gps.fix_quality self.data['GPS']['age'] = 0 else: - self.data['GPS']['age'] = int(self._gps_current_fix - self._gps_last_fix) + self.data['GPS']['age'] = int(self._gps_current_fix + - self._gps_last_fix) else: self.data['GPS'] = None