From df87990dcb394e60cf2876b041cd5a85dc4dfce9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 7 Apr 2023 16:05:15 -0400 Subject: [PATCH] add gps toggle with g --- cubesatsim/cubesatsim.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 18504470..0f102e69 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); @@ -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); @@ -3102,7 +3105,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; }