Main idea . Serial port interruptions are rare, so they should not affect the continuous cycle of the pressure regulator. Here is a piece of code with interruption from an incoming message, parsing of an incoming control line, and reading of an analog port.