arduino-fsm icon indicating copy to clipboard operation
arduino-fsm copied to clipboard

Light Example doesn't work unless run_machine() is called

Open WayneKeenan opened this issue 6 years ago • 2 comments

Internally m_initilaised is never set unless aforementioned function is called prior to entering loop()

WayneKeenan avatar Apr 06 '18 12:04 WayneKeenan

There are two ways around this,

The dirty way being: changing something in the the fsm.cpp file for now.

The nice way to have function like 'on_light_off_run(){}' which is inserted in the code:

State state_light_off(&on_light_off_enter, &on_light_off_run, &on_light_off_exit);

does nothing, but still ensures that m_initialised is set to true.

The fsm library assumes that the start state, referenced in the declaration of the state, is run first

JanHendrikStam avatar Sep 30 '18 16:09 JanHendrikStam

https://github.com/jonblack/arduino-fsm/pull/38

fkromer avatar May 11 '21 08:05 fkromer