No announcement yet.

SANDBOX-0012 state machine

  • Filter
  • Time
  • Show
Clear All
new posts

  • SANDBOX-0012 state machine

    ID: SANDBOX-0012
    STATUS: 30% complete (initial prototype)
    AUTHOR: Anna Ceguerra
    DATE: 13 October 2011
    Copyright © 2011 Anna Ceguerra

    This is a 3-state state machine where each state is represented by a function. The state machine "presses" buttons, which causes the movement from the current screen to the next screen that is signified by the button. This type of solution will be useful for programs with complex program flows, where each screen is represented by a state, and each button representing a transition from the current state/screen to the next screen. This has been tested on a uLCD-32032-P1-GFX2.

    It can be extended to more than 3 states, by adding the particular states in the appropriate sections, such as #DATA for the transitions, nstates, all_states and a new function for the new state.

    Possible enhancements include (1) reading states from a file, deleting current state functions and using a generic function representing all states from the file (2) incorporating user's button presses instead of using the current random button presses.

    Attached files statediagram.4dg (6 KB)