synchronous master-slave communication

My preference with this sort of thing has always been to separate the two functions, ie the IO action and the serial comms action.

IO is done periodically regardless and when asked for a value the most recent one is supplied so there is no waiting. OTOH if the IO is simply a read of a pin (using direct IO, not digitalRead()) it doesn't matter, I would not call any library functions though.


Rob