Question: Create a Finite machine Diagram while ( 1 ) { switch ( eNextState ) { case Transition _ NS _ State: eNextState = TransitionNorthSouthHandler (

Create a Finite machine Diagram
while (1){
switch (eNextState){
case Transition_NS_State:
eNextState = TransitionNorthSouthHandler();
break;
case NS_Pass_EW_Stop_State:
eNextState = NorthSouthPassHandler();
break;
case All_Stop_EW_State:
eNextState = AllStopEastWestHandler();
break;
case NS_Stop_EW_Pass_State:
EastWestPassHandler();
if (HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_3))
eNextState = Transition_EW_State;
else
eNextState = NS_Stop_EW_Pass_State;
break;
case Transition_EW_State:
eNextState = TransitionEastWestHandler();
break;
case All_Stop_NS_State:
eNextState = AllStopNorthSouthHandler();
break;
default:
eNextState = AllStopNorthSouthHandler();
break;
}
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!