g toggles display of gps info

pico-payload-gps-query
alanbjohnston 3 years ago committed by GitHub
parent 951109f7af
commit 5f7ae814d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,7 +65,7 @@ Adafruit_SI5351 clockgen = Adafruit_SI5351();
TinyGPS gps; TinyGPS gps;
unsigned long micros3; unsigned long micros3;
bool show_gps = false;
volatile int skip = 0; volatile int skip = 0;
//WiFiServer server(port); //WiFiServer server(port);
@ -2973,7 +2973,7 @@ void read_payload()
/**/ /**/
void payload_OK_only() 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 if ((Serial.available() > 0)|| first_time == true) // commented back in
{ {
@ -3010,6 +3010,9 @@ void payload_OK_only()
start_payload(); start_payload();
// setup(); // setup();
} }
else if (result == 'g') {
show_gps = !show_gps;
}
else if (result == 'C') { else if (result == 'C') {
Serial.println("Clearing stored gyro offsets in EEPROM\n"); Serial.println("Clearing stored gyro offsets in EEPROM\n");
EEPROM.put(0, (float)0.0); EEPROM.put(0, (float)0.0);
@ -3101,7 +3104,8 @@ void payload_OK_only()
while (Serial2.available()) while (Serial2.available())
{ {
char c = Serial2.read(); 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? if (gps.encode(c)) // Did a new valid sentence come in?
newData = true; newData = true;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.