Question: Write a code that performs the following using GPIO & Systick Interrupt: If Button 1 (PJ0) is pressed, LEDs turn ON/OFF in the following pattern:
Write a code that performs the following using GPIO & Systick Interrupt:
If Button 1 (PJ0) is pressed, LEDs turn ON/OFF in the following pattern: L1, L1 & L2, L1 & L2 & L3, L1 & L2 & L3& L4, L1 & L2 & L3, L1 & L2 , L1 .. If Button 2 (PJ1) is pressed, LEDs turn ON/OFF in the following pattern: L2 &L3, L1&L4, L2 &L3, L1&L4.
If both are released, all LEDs turn OFF.
Note: GPIO Interrupt is used to check which switch was pressed, and Systick to perform delays. Both interrupts are enabled as long as the code is running
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
