1. Engineering
  2. Computer Science
  3. i need only 2nd answer with screenshot of out put...

Question: i need only 2nd answer with screenshot of out put...

Question details

Write a program in C to modify the state of LED1 and LED2 depending upon whether SW1 or SW2 is pressed. At program startup, both LEDs should be turned off. As long as SW1 is pressed, LED1 should be turned on and as long as SW2 is pressed, LED1 and LED2 should blink at 5Hz alternately Summary: 1. LED1 Off No Switch Pressed SW1 Pressed SW2 Pressed After Releasing SW1/SW2 LED2 Off Off 5Hz (alternately) Off 5Hz Off 2. Bonus (up to 10 pts): If both switches are pressed, LED1 and LED2 should blink at the frequency of 1Hz and 2Hz respectively. When both switches are released, both LED1 and LED2 should be turned off Note: a. Implementation of bonus question needs to be as an extension of original assignment instead of as a separate program The statement If both switches are pressed implies that switches can be pressed any order and they does not have to be pressed at the same time b.

I need only 2nd answer with screenshot of out put too.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution