From 5f7ae814d3364e98fed9572c2e02ff589e7c0d00 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 7 Apr 2023 15:51:31 -0400 Subject: [PATCH] g toggles display of gps info --- cubesatsim/cubesatsim.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index e696c40d..ab6d62e5 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -65,7 +65,7 @@ Adafruit_SI5351 clockgen = Adafruit_SI5351(); TinyGPS gps; unsigned long micros3; - +bool show_gps = false; volatile int skip = 0; //WiFiServer server(port); @@ -2973,7 +2973,7 @@ void read_payload() /**/ void payload_OK_only() { - payload_str[0] = '\0'; // clear the payload string + payload_str[0] = '\0'; // clear the payload string if ((Serial.available() > 0)|| first_time == true) // commented back in { @@ -3010,6 +3010,9 @@ void payload_OK_only() start_payload(); // setup(); } + else if (result == 'g') { + show_gps = !show_gps; + } else if (result == 'C') { Serial.println("Clearing stored gyro offsets in EEPROM\n"); EEPROM.put(0, (float)0.0); @@ -3101,7 +3104,8 @@ void payload_OK_only() while (Serial2.available()) { char c = Serial2.read(); -// Serial.write(c); // uncomment this line if you want to see the GPS data flowing + if (show_gps) + Serial.write(c); // uncomment this line if you want to see the GPS data flowing if (gps.encode(c)) // Did a new valid sentence come in? newData = true; }