serialEvent(Serial port) realtime

Hi all,

I was wondering if anyone could tell me how void serialEvent function works - I know it is called when data is available from the serial port - but does it wait until it has run through the whole function before being called again, or does it run in parallel if there is another data point is available and it hasn’t finished processing the previous data point?

Also can saving data to a .txt file each time within this loop slow down the acquisition/process and saving of data via this functon?

1 Like
  • Callback serialEvent() is invoked by a Serial instance’s own Thread. :thread:
  • The same Thread won’t invoke next serialEvent() while it hadn’t finished the current 1.
2 Likes