SPLat Logo

Finite State Machines - Make light work of complex functions

Loading Menu...

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

State Machines are not difficult! - A FSM tutorial

By David Stonier-Gibson, SPLat Controls

Do you need an easy way make your programs respond to events or user actions in ways that can vary depending on past events, or history HelpTip?

Maybe you are programming one of the following:

  • Machine controllersHelpTip
  • Robotics
  • Games programsHelpTip
  • Transaction processingHelpTip
  • Communications protocols
  • Puzzle solversHelpTip

The Finite State Machine (FSM for short, sometimes called Finite State Automaton) is a programming technique that can handle such situations very easily. The most complicated aspect of finite state machines is the name itself. HelpTip.

The way I am going to do this is first of all to introduce you to a diagram that describes a finite state machine. That is in many ways the most important part, because it gives you a very powerful design tool. Then I will show you how to translate a State Diagram into program code. About 20 minutes from now you will have a powerful new tool in your programming arsenal.

Stop press

Since I wrote this tutorial we have developed a FSM design and programming tool that represents FSMs as a table. This is an alternative way of looking at them, and for some people may be easier. The tool is called Tabula™. It can be used to design and specify FSM programs for any platform, and also to generate programs for our embedded controller. Visit the Tabula FSM programming page

Buy a SPLat for $29.00

Program your own Finite State Machine using a SPLat Controller for only $29.00.

The EC1 "EasyOne", a 32-bit fully featured SPLat Controller with USB and true multi-tasking is a easy way to learn and a cheap way to build your project.

EC1 Controller