SPLat Logo

Finite State Machines - Make light work of complex functions

SPLat will be shutdown for the Christmas Holiday season from Thursday 20 December 2018 thru Sunday 6 January 2019. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

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.

VB.NET - Discussion

Because the VB.NET program is driven by events, the code for each state is scattered throughout the program. This means that there is little correspondence between a place in the state diagram and a place in the program code. State 0 is referenced in 5 places, state 1 in 4 places and state 2 in 3 places. That means that to change a behaviour of a state you might have to modify the code in an average of 4 places.

If you are able to actually run the code, you will notice one flaw: The temperature has to be changed before the program will repond to the temperature value. This is a result of the FSM being event triggered. No code actually runs unless there is an event. Consider it an exercise to resolve this.