Explaining how to write NON-blocking all time responsive code

Hi Everybody,

from time to time I enjoy writing tutorials in my kind and style.
My intention is to make it easy to understand. Though I'm aware:

  • of the fact that one way of explaining things is not the best way for everybody.
  • that the best experts about easyness-to-understand are: beginners .

I want to encourage especially beginners to ask whatever question comes to their mind.
I will use these questions as suggestion to improve the tutorial to become even more easy to understand.

The usual way of these (IMHO) very poor coded example-codes delivered with the arduino-IDE is blocking code

non-blocking all the time responsive code has only one single loop which is

void loop() itself

Sure - works. But how can I have actions that are repeated with a number that counts up / down?

The repeating is done by void loop() itself as loop() is repeating infinitely anyway

over time I will add more postings

3 Likes

reserved for future use

another one

four should be enough

A great idea and beginning. Thanks.

The only thing i’d mention, which you’ve already alluded to, is that the DoSomethung() functions must also avoid blocking activity (loops, delays etc).

Of course, this thread can be taken a very long way, and at some point beginners will lose interest until their own project needs to do more.

Great work.

Thank you Stefan - I love that you recognize that not everyone learns the same way, and that the best people to give feedback on understandability are beginners! I look forward to seeing more on this thread. :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.