//-*-c++-*-
#ifndef INCLUDED_RevSyncBehavior_h_
#define INCLUDED_RevSyncBehavior_h_
 
#include "Behaviors/StateMachine.h"
#include "Events/EventRouter.h"

class RevSyncBehavior : public StateNode {

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

startnode: StateNode

			red: LedNode [getMC()->flash(RobotInfo::RedLEDMask,10000);]
			yellow: LedNode [getMC()->flash(RobotInfo::YellowLEDMask,10000);]
			green: LedNode [getMC()->flash(RobotInfo::GreenLEDMask,10000);]
			blue: LedNode[getMC()->flash(RobotInfo::BlueLEDMask,10000);]

			howl: SoundNode($,"howl.wav")
			bark: SoundNode($,"barklow.wav")
			ping: SoundNode($,"ping.wav")
			toc: SoundNode($, "toc.wav")

			redR: LedNode [getMC()->flash(RobotInfo::RedLEDMask,10000);]
			yellowR: LedNode [getMC()->flash(RobotInfo::YellowLEDMask,10000);]
			greenR: LedNode [getMC()->flash(RobotInfo::GreenLEDMask,10000);]
			blueR: LedNode[getMC()->flash(RobotInfo::BlueLEDMask,10000);]

			howlR: SoundNode($,"howl.wav")
			barkR: SoundNode($,"barklow.wav")
			pingR: SoundNode($,"ping.wav")
			tocR: SoundNode($, "toc.wav")


 

			
      {red,howl} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {blueR, tocR}
			{red,howl} =C(1)=> {yellow,bark}

			{yellow,bark} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {redR,howlR}
			{yellow,bark} =C(1)=> {green,ping}

			{green,ping} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {yellowR,barkR}
			{green,ping} =C(1)=> {blue,toc}

			{blue,toc} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {greenR,pingR}
			{blue,toc} =C(1)=> {red,howl}


			
			{redR,howlR} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {yellow,bark}
			{redR,howlR} =C(1)=> {blueR, tocR}


			{blueR,tocR} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {red,howl}
			{blueR,tocR} =C(1)=> {greenR,pingR}

			{greenR,pingR} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {blue,toc}
			{greenR,pingR} =C(1)=> {yellowR,barkR}

			{yellowR,barkR} =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> {green,ping}
			{yellowR,barkR} =C(1)=> {redR,howlR}


			startnode =N=> {red, howl}

#endstatemachine
  }       // end of setup()

};

#endif


