Efficient way for reading input commands

Robin2 handles that as shown here by using a flag called newData, initialised false. No actions are performed on data while that flag is false. It gets set true when data is* read, which enables the action, done under control of an if looking at that flag. Then as soon as the action is complete (in the example the action is simply to show the data, but it could be anything) the flag is set false again, so the action cannot happen again until the flag is set true on the arrival of more data.

*yes I know, it's plural :wink: