Then this should work...
void setup() {
Serial.begin(57600); // gps TX,RX on 0,1
}
void loop() {
if (Serial.available()) {
Serial.print(Serial.read());
}
}
except that it doesn't. If I hold in the reset button -- so that presumably the microcontroller isn't doing anything -- then I see the NMEA messages come out. As soon as I release the reset button then nothing is printed anymore, except sometimes I see one more sentence.
However, the following code does work,
#include <SoftwareSerial.h>
SoftwareSerial gps(3, 2); // gps TX,RX on 2,3
void setup() {
Serial.begin(57600); // serial monitor
gps.begin(57600); // serial to GPS
}
void loop() {
gps.listen(); // doesn't seem to matter if this is here or not
if (gps.available()) Serial.print((char)gps.read());
if (Serial.available()) gps.print((char)Serial.read());
}