#ifndef _GRIPPER
#define _GRIPPER

#include "servobits.h"
#define SDoNothing   0
#define SWrite       1
#define SWait        2
#define SReply       3


typedef struct
{
  byte channel;
  byte State;
  byte goalPosition;
  byte inPositionFlag;        //high if in pos, low if out of pos
  byte sendDoneReply;         //set as true to signal reply ready
  
  uint8 source;    // add these to hold who reguested the current move
  uint8 tag;         // if this field is 0 then no move in progress
  uint8 cmdType;   //rel or absolute
  enum servoReason reason;  //the information sent back at the completion of a move
	
}Gripper;


void gripperISR(Gripper* grp);
void initGripper(Gripper* grp,byte channel);


#endif
