 | Code: PFcomboDirectMode(tSensors link, int channel, eCDMMotorCommand _motorB, eCDMMotorCommand _motorA);//This is used to run both motors in a //bang-bang configuration when they're //within the line-of-site of the IRLink. tSensors link is the port of the IRLink (S1-S4), channel is one of the four IR channels (0-3), //and the eCDMMotorCommands are these: //CDM_MOTOR_FLOAT = 0, /*!< Float the motor */ //CDM_MOTOR_FWD = 1, /*!< Forward */ //CDM_MOTOR_BAK = 2, /*!< Reverse */ //CDM_MOTOR_BRAKE = 3 /*!< Brake the motor */ PFcomboPwmMode(tSensors link, int channel, ePWMMotorCommand _motorB, ePWMMotorCommand _motorA);//This is the same as the one above, except the //motors continues running without having to receive messages, and it allows speed control. The speed commands are: //MOTOR_FLOAT = 0, /*!< Float the motor */ //MOTOR_FWD_PWM_1 = 1, /*!< Forward speed 1 */ //MOTOR_FWD_PWM_2 = 2, /*!< Forward speed 2 */ //MOTOR_FWD_PWM_3 = 3, /*!< Forward speed 3 */ //MOTOR_FWD_PWM_4 = 4, /*!< Forward speed 4 */ //MOTOR_FWD_PWM_5 = 5, /*!< Forward speed 5 */ //MOTOR_FWD_PWM_6 = 6, /*!< Forward speed 6 */ //MOTOR_FWD_PWM_7 = 7, /*!< Forward speed 7 */ //MOTOR_BRAKE = 8, /*!< Brake the motor */ //MOTOR_REV_PWM_7 = 9, /*!< Reverse speed 7 */ //MOTOR_REV_PWM_6 = 10, /*!< Reverse speed 6 */ //MOTOR_REV_PWM_5 = 11, /*!< Reverse speed 5 */ //MOTOR_REV_PWM_4 = 12, /*!< Reverse speed 4 */ //MOTOR_REV_PWM_3 = 13, /*!< Reverse speed 3 */ //MOTOR_REV_PWM_2 = 14, /*!< Reverse speed 2 */ //MOTOR_REV_PWM_1 = 15 /*!< Reverse speed 1 */ PFMotor(tPFmotor pfmotor, ePWMMotorCommand _motorCmd);//The last (and simplest, IMHO) command. Simply identify the motor using one of these: //pfmotor_S1_C1_A = 0, /*!< Motor A, Channel 1, IR Link connected to S1 */ //pfmotor_S1_C1_B, /*!< Motor B, Channel 1, IR Link connected to S1 */ //pfmotor_S1_C2_A, /*!< Motor A, Channel 2, IR Link connected to S1 */ //pfmotor_S1_C2_B, /*!< Motor B, Channel 2, IR Link connected to S1 */ //pfmotor_S1_C3_A, /*!< Motor A, Channel 3, IR Link connected to S1 */ //pfmotor_S1_C3_B, /*!< Motor B, Channel 3, IR Link connected to S1 */ //pfmotor_S1_C4_A, /*!< Motor A, Channel 4, IR Link connected to S1 */ //pfmotor_S1_C4_B, /*!< Motor B, Channel 4, IR Link connected to S1 */ //pfmotor_S2_C1_A, /*!< Motor A, Channel 1, IR Link connected to S2 */ //pfmotor_S2_C1_B, /*!< Motor B, Channel 1, IR Link connected to S2 */ //pfmotor_S2_C2_A, /*!< Motor A, Channel 2, IR Link connected to S2 */ //pfmotor_S2_C2_B, /*!< Motor B, Channel 2, IR Link connected to S2 */ //pfmotor_S2_C3_A, /*!< Motor A, Channel 3, IR Link connected to S2 */ //pfmotor_S2_C3_B, /*!< Motor B, Channel 3, IR Link connected to S2 */ //pfmotor_S2_C4_A, /*!< Motor A, Channel 4, IR Link connected to S2 */ //pfmotor_S2_C4_B, /*!< Motor B, Channel 4, IR Link connected to S2 */ //pfmotor_S3_C1_A, /*!< Motor A, Channel 1, IR Link connected to S3 */ //pfmotor_S3_C1_B, /*!< Motor B, Channel 1, IR Link connected to S3 */ //pfmotor_S3_C2_A, /*!< Motor A, Channel 2, IR Link connected to S3 */ //pfmotor_S3_C2_B, /*!< Motor B, Channel 2, IR Link connected to S3 */ //pfmotor_S3_C3_A, /*!< Motor A, Channel 3, IR Link connected to S3 */ //pfmotor_S3_C3_B, /*!< Motor B, Channel 3, IR Link connected to S3 */ //pfmotor_S3_C4_A, /*!< Motor A, Channel 4, IR Link connected to S3 */ //pfmotor_S3_C4_B, /*!< Motor B, Channel 4, IR Link connected to S3 */ //pfmotor_S4_C1_A, /*!< Motor A, Channel 1, IR Link connected to S4 */ //pfmotor_S4_C1_B, /*!< Motor B, Channel 1, IR Link connected to S4 */ //pfmotor_S4_C2_A, /*!< Motor A, Channel 2, IR Link connected to S4 */ //pfmotor_S4_C2_B, /*!< Motor B, Channel 2, IR Link connected to S4 */ //pfmotor_S4_C3_A, /*!< Motor A, Channel 3, IR Link connected to S4 */ //pfmotor_S4_C3_B, /*!< Motor B, Channel 3, IR Link connected to S4 */ //pfmotor_S4_C4_A, /*!< Motor A, Channel 4, IR Link connected to S4 */ //pfmotor_S4_C4_B, /*!< Motor B, Channel 4, IR Link connected to S4 *///And then use the above PWM commands to control the speed. It also //continues moving without continuos IR messages. It only controls one motor at a time. |  |