State Machine
The state machine was implimented using what simulink calls a "multiport switch" as a ROM table. By inputing the present value of the state variable, the program indexed and addressed the current variables it needed to deal the card ot the right position. The variables it used included Left(0) or Right(1), Card Position (positive or negative integer based on starrtup position being 0), Whether to wait for the PushButton or the Motors to settle, and what the next state would be.
