GPS-view output on serial monitor or plotter

A common method of easily checking that a GPS module is outputting serial data is the serial passthrough which displays on the serial monitor each byte available in the serial buffer:
while (Serial.available()) Serial.write(Serial.read()); //displays ASCII characters

Another method is to use the serial plotter to trace the status of the GPS TX pin:
Serial.println(digitalRead(receivingPin)); //plots 1 or 0


Maybe the plotter method is just a curiosity but I think it's of interest and instructive.
The sketch:

/*GPS pass thru two ways;
   uses one of two methods:
   1. traces status of GPS TX pin on serial plotter
   or
   2. displays GPS output on serial monitor as ACSII sentences
*/

const int  receivingPin = 0;    // GPS TX connected to this digital pin

void setup() {
  // initialize the receiving pin as input:
  pinMode(receivingPin, INPUT);

  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
  //comment out the method you do NOT want to use

  //use this method to trace status of GPS TX pin on plotter
  Serial.println(digitalRead(receivingPin));  //plots 1 or 0

  //use this method to display GPS sentences on monitor
  while (Serial.available()) Serial.write(Serial.read());

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.