Question: Lab 7 Interrupts 1. Write a program that does the following- a. b. c. Blink the red LED on and off with a period of

Lab 7 Interrupts 1. Write a program that does the following- a. b. c. Blink the red LED on and off with a period of 500 ms with a duty cycle of 50 %. Display on the LCD a count of the number of times that the LED has been turned on. Using interrupt service routines: I. Joystick is moved right 1. Clear the LCD display. 2. Stop the blinking of the red LED . Blink the blue LED on and off with a period of 250ms for a total of 20 times where the duty cycle is 50 %. Display a time at which the red LED stopped blinking and the total number of times that the blue LED has turned on (including all times when this ISR was called). Clear the LCD display. 4. 5. ll. Joystick is moved left: Clear the LCD display. Continue the blinking of the red LED. Blink the green LED on and off with a period of 1 s for a total of 6 times with a duty cycle of 25%. Display in real time the count of the number of times that the green and the red LEDs are blinking during the ISR. Do not increment the count of the number of times that the red LED has been turned on when the program returns to the main function. Clear the LCD display. 1. 2. 4. 5. ii. Joystick is moved up 1. 2. 3. Clear the LCD display. Continue the blinking of the red LED. Use a random number generator to determine the period to blink the blue LED where the period is allowed to range from 500 ms to 3 s in multiples of 500 ms. The duty cycle should be 50 %. 4. Blink the blue LED using the period calculated in Step 2 of this section. 5. Display the period while the blue LED blinks 8 times 6. Record the number of times that the red LED blinks and add it to the count when the program returns to the main function Clear the LCD display 7. Lab 7 Interrupts 1. Write a program that does the following- a. b. c. Blink the red LED on and off with a period of 500 ms with a duty cycle of 50 %. Display on the LCD a count of the number of times that the LED has been turned on. Using interrupt service routines: I. Joystick is moved right 1. Clear the LCD display. 2. Stop the blinking of the red LED . Blink the blue LED on and off with a period of 250ms for a total of 20 times where the duty cycle is 50 %. Display a time at which the red LED stopped blinking and the total number of times that the blue LED has turned on (including all times when this ISR was called). Clear the LCD display. 4. 5. ll. Joystick is moved left: Clear the LCD display. Continue the blinking of the red LED. Blink the green LED on and off with a period of 1 s for a total of 6 times with a duty cycle of 25%. Display in real time the count of the number of times that the green and the red LEDs are blinking during the ISR. Do not increment the count of the number of times that the red LED has been turned on when the program returns to the main function. Clear the LCD display. 1. 2. 4. 5. ii. Joystick is moved up 1. 2. 3. Clear the LCD display. Continue the blinking of the red LED. Use a random number generator to determine the period to blink the blue LED where the period is allowed to range from 500 ms to 3 s in multiples of 500 ms. The duty cycle should be 50 %. 4. Blink the blue LED using the period calculated in Step 2 of this section. 5. Display the period while the blue LED blinks 8 times 6. Record the number of times that the red LED blinks and add it to the count when the program returns to the main function Clear the LCD display 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
