After sorting out how works 16 bit hardware timer it is time for 4 digits countdown timer. Having 16 bit timer and 7 segments LED code from earlier only were remaining to write timer’s modes (run/setup) and button’s control code. After putting all code to one place there is countdown timer with properties below:
- Maximum 99 minutes 59 seconds countdown interval
- 1 second resolution
- Sound indication with buzzer for finished countdown
- LED indicates running timer, or relay instead for powering external devices for some period of time
- 2 buttons to set timer and start/pause/reset.
This time without additional code quotation, please find some code explanation within code, so code bellow.