Question: Implementing a Moore finite state machine on TM4C123 in C and using switches to control the state transitions. I have the following code written to
Implementing a Moore finite state machine on TM4C123 in C and using switches to control the state transitions. I have the following code written to implement an FSM that starts with a green LED on and three other LEDs off until a switch is pressed. If switch 1 is pressed, the green LED turns off and the white LED will flash on and off and then the green LED will turn back on (white LED now off). If switch 2 is pressed then the yellow LED will turn on (all other LEDs turn off), then the red and white LED will turn on (all other LEDs turn off). Finally, if both switches are pressed then the two patterns are combined. The state transitions have been written, but I'm not sure how to implement the switches so that the transitions only happen according to which switch is pressed. Switch 1 is connected to PA2, switch 2 is connected to PA3. Any help is appreciated!

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
