Is there a way to temporarily disable serial.event? I use serial.event to automatically read the serial buffer to a an array. However, there are some instances that I want to disable this and use serial.readbytes instead.
Is there a way to temporarily disable serial.event?
No. If you create the properly named function, it will be called right after loop, every time loop ends.
I use serial.event to automatically read the serial buffer to a an array. However, there are some instances that I want to disable this and use serial.readbytes instead.
The method is not called whenever there is serial data. It is called when loop ends AND there is serial data.
So, rename the method, so it is not called automatically, and call it, or not, at the end of loop(). That way, you can enable/disable the call as you see fit.
ambokyo:
Is there a way to temporarily disable serial.event? I use serial.event to automatically read the serial buffer to a an array. However, there are some instances that I want to disable this and use serial.readbytes instead.
Why ?
PaulS:
The method is not called whenever there is serial data. It is called when loop ends AND there is serial data.
Thanks this made it clear.