# Non-blocking countdown sport timer implementation question

**URL:** <https://forum.arduino.cc/t/non-blocking-countdown-sport-timer-implementation-question/1146090>\
**Category:** Programming\
**Created:** [July 9, 2023, 1:18am UTC](https://forum.arduino.cc/t/non-blocking-countdown-sport-timer-implementation-question/1146090 "2023-07-09T01:18:20Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![StefanL38](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefanl38/32/713548_2.png) [@StefanL38](https://forum.arduino.cc/u/StefanL38)\
**Post date:** [July 9, 2023, 7:51am UTC](https://forum.arduino.cc/t/non-blocking-countdown-sport-timer-implementation-question/1146090/7 "2023-07-09T07:51:51Z")

</div>

> [@Eliminateur](#):
>
> what about the rest of the core code?

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

> [@Explaining how to write NON-blocking all time responsive code](https://forum.arduino.cc/t/explaining-how-to-write-non-blocking-all-time-responsive-code/1126414/1):
>
> 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 u…

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

> [@Eliminateur](#):
>
> 1. BEEP (beeps for 1 second, this is a simple output)
> 2. 10 second countdown
> 3. BEEP
> 4. 180 second countdown (shift A)
> 5. BEEP
> 6. 10 second countdown again
> 7. BEEP  
> 8 180 second countdown with all decimal points lit (shift B)
> 8. BEEP 3 times
> 9. Goes back to standby with 3 dashes on display(could be displaying other stuff)

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

> [@A Demo-Code explaining the switch-case state-machine and how to do things (almost) in parallel](https://forum.arduino.cc/t/a-demo-code-explaining-the-switch-case-state-machine-and-how-to-do-things-almost-in-parallel/888172/1):
>
> Hi everybody, if you look at the end of this first posting you see a list of links that show where this tutorial was used as a link. Go through this list to find additional information on how to apply this code This democode requires only the pure microcontroller without any hardware. You just open the serial monitor to watch the behaviour of the code. From time to time I enjoy writing demo-codes that want to explain programming-functionalities. There are a lot of different approachs to expl…

best regards Stefan

---

_[View the full topic](https://forum.arduino.cc/t/non-blocking-countdown-sport-timer-implementation-question/1146090)._
