Serial write time

yukikami:
This is how my sketch works :

  • I have a buffer with all the 8 bytes blocks of data that I need to send
  • in the loop, I empty this buffer and when it is empty, I just continuously update the values measured by 2 sensors
  • on the other hand, I have 3 rotary encoders which all have their own interrupts, they all just increment an int, but in only one of them, I also add an 8 bytes piece of data (which represents all the current states of the sensors + encoders) in the buffer

I can't figure from this rather too brief description how the speed of Serial.write() has any impact.

Why would you update the buffer in an interrupt routine? Why not just do it in loop()?

Have you posted a copy of your code?

...R