Gripper & Experimenter’s Module
void
sfRobotCom2Bytes(int com, int high, int low)
{
sfRobotComInt(com, ((high & 0xff)<<8) + (low & 0xff));
}
/*************************************************************
*Speaker functions
*Format of string is L1 T1 L2 T2 .... Ln Tn
*where Li is length of tone i in 20ms increments
* | and Ti is tone |
* |
|
*Max length of string is 40 bytes (20 tones)
**************************************************************/
void
sfPlayToneString(char *str, int n)
{
if (n > 40) n = 40; sfRobotComStrn(sfCOMSAY, str, n);
}
/*************************************************************
*Gripper functions
*
*States are sfUP, sfDOWN, sfMIDDLE, sfOFF, and sfMOVING
*sfMOVING occurs only during transitions between states
*sfOFF can be set by the user, which means no state control
*sfOFF can be set by the robot to indicate a timeout
*
**************************************************************/
/* states */ |
|
#define sfGRIPOFF | 0 |
#define sfGRIPUP | 1 |
#define sfGRIPMOVING 2 #define sfGRIPMIDDLE 4 #define sfGRIPDOWN 5 #define sfCOMGRIPPER 33
(continued)
21