Pages: [1]   Go Down
Author Topic: serialEvent with software serial  (Read 602 times)
0 Members and 1 Guest are viewing this topic.
BCC AZ USA
Offline Offline
Edison Member
*
Karma: 38
Posts: 1309
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a way to use serialEvent (or something like that) with a software serial port or is polling necessary? 

Charlie
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50452
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All that serialEvent() does is register a callback to be called at the end of loop. In that function, you still need to call Serial.available() to see how much data, if any, there is to process.

The end result is that it really offers no benefit over polling.
Logged

BCC AZ USA
Offline Offline
Edison Member
*
Karma: 38
Posts: 1309
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the answer.  I was thinking that serialEvent was more like an interrupt.

Charlie
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think serialEvent() is tied to hardware serial port(s).
Logged

Pages: [1]   Go Up
Jump to: