2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 | delay(1000); delay(1000); if(flag1){ Timer1.stop(); Serial.println(NMEA); flag=0; } if(GPSSerial.available()>0){ NMEA.concat(c); if(c'r'){ } |
SoftwareSerial
. If you could use Serial
, Serial1
, Serial2
or Serial3
, you should use NeoHWSerial instead. If you could use an Input Capture pin (ICP1, pins 8 & 9 on an UNO), you should consider NeoICSerial instead.SoftwareSerial
, except for two new methods, attachInterrupt
and detachInterrupt
:SoftwareSerial
:attachInterrupt
for digital pins.rx_buffer
, and it will not be returned from read()
. Any characters that were received and buffered before attachInterrupt
was called remain in rx_buffer
, and could be retrieved by calling read()
.attachInterrupt
is never called, or it is passed a NULL
procedure, the normal buffering occurs, and all received characters must be obtained by calling read()
.