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 I/O sample program we discussed in class. The code is posted under Modules. Basically when the switch is open, LED1 toggles, and when switch is closed, LED2 toggles.
Modify the program, so that at the push of the button, the micro cycles through 4 different modes of operation. The areas to be modified are marked below in red.
Hint: use a counting semaphore (1-3), which is incremented whenever the switch is closed, and it resets to 1 when it reaches value >=4. When the switch is open, the software uses a case statement to execute the 4 different modes of operations based on the semaphore value as follows:
value 1; LED1 flashes while LED2 off
value 2; LED2 flashes while LED1 off
value 3; LED1 and LED2 flash simultaneously
value 4: LED1 and LED alternate
 Please read the question and its hints very well. Use the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!