   {
     BlinkRGB* rgb = (BlinkRGB*) fsm;
     rgb->blueLedPin.toggle();
-    fsm->set_timer(TIMEOUT);
+    fsm->set_timer(rgb->timeout);
     fsm->set_state(blueState);
     return (1);
   }

  {
    BlinkRGB* rgb = (BlinkRGB*) fsm;
    rgb->greenLedPin.toggle();
    fsm->set_timer(TIMEOUT);
    fsm->set_state(magentaState);
    return (1);
  }

  {
    BlinkRGB* rgb = (BlinkRGB*) fsm;
    rgb->redLedPin.toggle();
    fsm->set_timer(rgb->timeout);
    fsm->set_state(redState);
    return (1);
  }
};

// The state machines
BlinkRGB led1(512, 5, 6, 7);
BlinkRGB led2(256, 8, 9, 10);

void setup()
{
  // Start the watchdog (16 ms timeout, push timeout events)
  Watchdog::begin(16, SLEEP_MODE_IDLE, Watchdog::push_timeout_events);

  // Start the state machines
  led1.begin();
  led2.begin();
}

void loop()
