I have come across several examples about serialEvent() function, which look like this:
void serialEvent(){
if(Serial.available()){
\\do something
}
}
The serialEvent() function is called when data is available, so which is the necessity of the if
(or while
) structure since that would be always true
?
(In several cases I have excluded the if
structure, and the code works fine)