Declarative Finite State Machine Runner

Warning message

The Propeller Object Exchange system is decommissioned and replaced with a GitHub repository to house the same existing and future Propeller objects. As of 12/5/2019, this site is read-only. You can continue to browse and download objects from here for a limited time; however, please begin using the Parallax Propeller repository for future reference.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: created: 2015-05-06 | updated: 2015-05-06

Managing state transitions in a large event-driven state machine application can be tedious. Often it is easier to define the states and transitions declaratively -- in a list or table.

The FSMRunner parses a state machine declaration defined in a data (DAT) section and calls out to user functions as needed. You write your support functions in SPIN and describe the state transitions in the table. The FSMRunner ties the two together.

The archive includes a "25 cent soda machine" simulator. Use the serial terminal to put in nickels, dimes, and quarters. The state machine keeps up with your total input and lets you have a soda when the price is right.

You can also see the state machine runner in action in Propeller Tic Tac Toe here:

This runner (and the Tic Tac Toe code) is part of my state-machine work on GitHub here:

Original File Upload
Package icon SodaMachine - Archive [Date 2015.05.06 Time 18.09].zip21 KB