Question: 2. Make a program main.c to use the input interrupt to detect if a button is pressed witht the PIC24E chip. Assume the button is
2. Make a program "main.c" to use the input interrupt to detect if a button is pressed witht the PIC24E chip.
Assume the button is connected to Pin A0. If the button is pressed, turn the LED on. Otherwise, turn the LED off.
Use a state machine to handle the bouncing button issue. The state machine should toggle the LED only if the button changes its state for at least 10ms.
a) Draw the diagram of the state machine.
b) Show the code of main.c that uses the state-centric approach to implement the diagram.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
