//-*-c++-*-

/* BlinkBehavior.h.fsm
 * Code for HW1 question 1. Waits for a green button press and then flashes 
 * the green LED for 1 second.
 * @author David Klionsky (dklionsk)
 * @author Carl Doersch (cdoersch)
 */

#ifndef INCLUDED_BlinkBehavior_h_
#define INCLUDED_BlinkBehavior_h_
 
#include "Behaviors/StateMachine.h"
#include "Events/EventRouter.h"

class BlinkBehavior : public StateNode {

public:
  BlinkBehavior() : StateNode("BlinkBehavior") {}
 
  virtual void setup() {
#statemachine

startnode: StateNode =N=> {noblink, wait}

noblink: LedNode [setPriority(MotionManager::kBackgroundPriority);
	          getMC()->set(RobotInfo::FaceLEDMask,0.0);]

wait: StateNode
  =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>
     blink: LedNode [getMC()->flash(RobotInfo::GreenLEDMask, 1000);] =T(1000)=> wait

#endstatemachine
  }       // end of setup()

};

#endif
