Non-blocking countdown sport timer implementation question

This tutorial is not a direct example of counting down and beeping but explains basic principles how non-blocking code must be written

and this tutorial explains how to code non-blocking to perform a sequence of actions

In your first posting you wrote such a list with a sequence of actions

you can see each number as a certain mode of operation.
mode 1: BEEP (beeps for 1 second, this is a simple output)
mode 2: 10 second countdown
etc.

In programming some highly sophisticated scientist gave these modes of operation the name

state

and the code-structure that is executing different parts of the code depending on each "state" is called a state-machine
here is a tutorial how to use state-machines

best regards Stefan

1 Like