The above image shows the state diagram for the main state machine called PEdANTSM that controls all other services. There are three timers being used. The Task Timer is set once the user moves from the Welcome State to the Select Choice state. After this, the timer runs for 60 seconds and no matter which state the user is in at the end of 60 seconds, the system moves to the EndOfTask state. The next timer being used is to check for No Inputs from the user. If the user is controlling either the window or the curtain, the No Input Timer is set to 5 seconds. Every time the user touches the joystick or blocks an IR sensor, this timer is reset. If the user does nothing for 5 seconds, the user is transitioned to the IsSatisfied state. If the user is not controlling the window or curtain, the No Input timer is set to 20 seconds. If the 20 second timer times out, then the user is transitioned to the EndOfTask state and receives a message saying that they were inactive for too long. The last timer is the reset Timer, which is only set once the user enters the EndOfTask state. This timer is set to 20 seconds, and once it times out, the user is sent to the Welcome state.
State Diagram of UpdateDisplayService
This state diagram is used to control the various messages and instructions being sent to the Matrix Display. The "Update ..." events are used to signify actions related to the Snake Clock Service module and the Cursor Service module.
State Diagram of CursorService
This simple state diagram is used to manipulate the cursor to the user's choice in the display. It is used to choose Window (W) or Curtain (C) in the Select Choice State. It is used to choose if you want to make changes (Y) or not (N) in the Is Satisfied State.