/***************************************************/ /* COP libray based on the NexT Byte Codes library */ /***************************************************/ #define MOTOR_A 0x00 #define MOTOR_B 0x01 #define MOTOR_C 0x02 /*****************************************************************************/ /* Motor API */ /*****************************************************************************/ /**/ /**/ /**/ /*******************************/ /* this function rotates motor */ /* forward */ /*******************************/ void COP_RotateMotorOnFwd(byte *motors,int power) { inline "OnFwd(COP_RotateMotorOnFwd_motors,COP_RotateMotorOnFwd_power)"; } /**/ /**/ /**/ /*******************************/ /* this function rotates motor */ /* reverse */ /*******************************/ void COP_RotateMotorOnRev(byte *motors,int power) { inline "OnRev(COP_RotateMotorOnRev_motors,COP_RotateMotorOnRev_power)"; } /**/ /**/ /**/ /*********************************/ /* this function rotates motor */ /* forward but synchronized them */ /*********************************/ void COP_RotateMotorOnFwdSync(byte *motors,int power,schar turnpct) { inline "OnFwdSync(COP_RotateMotorOnFwdSync_motors,COP_RotateMotorOnFwdSync_power,COP_RotateMotorOnFwdSync_turnpct)"; } /**/ /**/ /**/ /*******************************/ /* this function rotates motor */ /* rev but synchronized them */ /*******************************/ void COP_RotateMotorOnRevSync(byte *motors,int power,schar turnpct) { inline "OnRevSync(COP_RotateMotorOnRevSync_motors,COP_RotateMotorOnRevSync_power,COP_RotateMotorOnRevSync_turnpct)"; } /**/ /**/ /**/ /*******************************/ /* this function stops motors */ /*******************************/ void COP_RotateMotorStop(byte *motors) { inline "Off(COP_RotateMotorStop_motors)"; } /**/ /**/ /**/ /*******************************/ /* this function stops motors */ /* without braking */ /*******************************/ void COP_RotateMotorCoast(byte *motors) { inline "Coast(COP_RotateMotorCoast_motors)"; } /**/ /**/ /**/ /*******************************/ /* this function rotates motor */ /* according to a given power */ /* and angle */ /*******************************/ void COP_RotateMotor(byte *motors,int power, sint angle) { inline "RotateMotor(COP_RotateMotor_motors,COP_RotateMotor_power,COP_RotateMotor_angle)"; } /**/ /**/ /**/ /*******************************/ /* this function rotates motor */ /* according to a given power */ /* and angle and sync */ /*******************************/ void COP_RotateMotorEx(byte *motors,int power, sint angle, char turnpct, schar bsync) { inline "RotateMotorEx(COP_RotateMotorEx_motors,COP_RotateMotorEx_power,COP_RotateMotorEx_angle,COP_RotateMotorEx_turnpct,COP_RotateMotorEx_bsync)"; }