From 6eca95178d98106f9c20b47bcc51adbf8e6fda64 Mon Sep 17 00:00:00 2001 From: raidlman Date: Sat, 3 Feb 2018 13:31:45 +0100 Subject: [PATCH] Add fsm.run_machine() to arduino setup routine. Example won't run if run_machine() is not called (even if there are no timed transitions). Otherwise m_initialized will be false forever and states won't do transitions. --- examples/light_switch/light_switch.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/light_switch/light_switch.ino b/examples/light_switch/light_switch.ino index 93fcd2e..fa350e3 100644 --- a/examples/light_switch/light_switch.ino +++ b/examples/light_switch/light_switch.ino @@ -49,11 +49,11 @@ void setup() fsm.add_transition(&state_light_off, &state_light_on, FLIP_LIGHT_SWITCH, &on_trans_light_off_light_on); + fsm.run_machine(); } void loop() { - // No "fsm.run_machine()" call needed as no "on_state" funcions or timmed transitions exists delay(2000); fsm.trigger(FLIP_LIGHT_SWITCH); delay(2000);