Question: Please read the question and its hints very well. Use the skeleton program as instructed and modify the lines in red color. Any submitted program
Please read the question and its hints very well. Use the skeleton program as instructed and modify the lines in red color. Any submitted program that is not based on the provided skeleton will not be accepted.
The following program is the simple IO sample program we discussed in class. The code is posted under Modules. Basically when the switch is open, LED toggles, and when switch is closed, LED toggles.
Modify the program, so that at the push of the button, the micro cycles through different modes of operation. The areas to be modified are marked below in red.
Hint: use a counting semaphore which is incremented whenever the switch is closed, and it resets to when it reaches value When the switch is open, the software uses a case statement to execute the different modes of operations based on the semaphore value as follows:
value ; LED flashes while LED off
value ; LED flashes while LED off
value ; LED and LED flash simultaneously
value : LED and LED alternate
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
