commit 94d382dd16a3f92080bf4ca52f86fb3592f69cc4 Author: James Devine Date: Fri Aug 2 21:06:39 2019 +0000 diff --git a/CosmicPi1point6GPSTest b/CosmicPi1point6GPSTest new file mode 100644 index 0000000..8b793eb --- /dev/null +++ b/CosmicPi1point6GPSTest @@ -0,0 +1,21 @@ +/* +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) + } +} \ No newline at end of file