Created
August 2, 2019 21:06
-
-
Save pingud98/9ed04a82345f606cdb44a2e4a4b05016 to your computer and use it in GitHub Desktop.
GPS comms test for cosmic pi version 1.6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GPS test routine, based on serial passthrough from the Arduino standard examples | |
which was originally written by by Erik Nyquist, kudos! | |
it wasn't working using 'serial' so I changed it to a non-reserved name and BINGO. :) | |
*/ | |
HardwareSerial GPS(PA10,PB6); | |
void setup() { | |
Serial.begin(9600); | |
GPS.begin(9600); | |
} | |
void loop() { | |
if (Serial.available()) { // If anything comes in Serial (USB), | |
GPS.write(Serial.read()); // read it and send it out Serial1 (pins 0 & 1) | |
} | |
if (GPS.available()) { // If anything comes in Serial1 (pins 0 & 1) | |
Serial.write(GPS.read()); // read it and send it out Serial (USB) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment