Thanks Larz, though that is not quite what I'm after.
I guess what I'm asking is - when I see example code it's always setting up for a particular job. Watch for an incoming UDP packet over network. Wait for an incoming IR signal. Wait for the user to press a button. Etc. Each of these things is always given in a function with a singular purpose - makes the code easy.
But what if I want the device to both wait for a UDP packet, and also keep an eye on an IR signal and wait on the button press (or any other types of inputs / stimulus). IS this a case for round robin checking of sensors? Then I think I'll probably miss half an IR signal, or miss the UDP packet, etc. Can I have multiple functions watching all at once?... Not sure. What would be the term to research to look at that?
I guess what I'm asking is - when I see example code it's always setting up for a particular job. Watch for an incoming UDP packet over network. Wait for an incoming IR signal. Wait for the user to press a button. Etc. Each of these things is always given in a function with a singular purpose - makes the code easy.
But what if I want the device to both wait for a UDP packet, and also keep an eye on an IR signal and wait on the button press (or any other types of inputs / stimulus). IS this a case for round robin checking of sensors? Then I think I'll probably miss half an IR signal, or miss the UDP packet, etc. Can I have multiple functions watching all at once?... Not sure. What would be the term to research to look at that?