Pages: [1]   Go Down
Author Topic: Serial.end and SoftwareSerial.end - does it clear the character buffer?  (Read 340 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 3
Posts: 270
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a need to start off with an empty character buffer so that subsequent calls to Serial.read only returns new information.  If I call Serial.end and then Serial.begin(4800) again, does that give me an empty character buffer?
Logged

Arduino Uno;
Mega328

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 686
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
while(Serial.available()>0) Serial.read();
Logged

//LiNK

0
Offline Offline
Sr. Member
****
Karma: 3
Posts: 270
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
while(Serial.available()>0) Serial.read();

Thanks!  I have a follow up question but it is long so I will put it in its own thread under the Programming forum. 
Logged

Arduino Uno;
Mega328

Pages: [1]   Go Up
Jump to: