- 8051 MCU
- Two 7-segment displays
- Two push button
- Two LEDs
This happens by using main two functions that control the displaying numbers on 7-segments. They use look-up table and decremented until reach the lower value (value 0) then return to the end (value 9).
This feature aims to control the frequency of change of 7-segments values. This is done using a variable that is incremented by a switch and another switch to just return the variable to a pre-defined value.
‘SWITCH’ function sets flags in case of pressing on reset or delay buttons
‘INCREMENT’ function executes the functions according to flags values
This is done by incrementing ‘MAX’ variable. The same logic as the above (SWITCH’ function sets flags and SWITCH’ function sets flags)
The two flags is set in initialization
When each of 7-segments reaches zero -> the the flag
‘LED’ function is continuously called in main and check for the flag
If the condition is verified then toggle LEDs