ROBOTC.net Blog  

ROBOTC News

Using the VEX Motor Controller 29

3 comments

The VEX Motor Controler 29 allows you to connect the powerful VEX 2-wire Motors to any of the standard 3-wire ports on the VEX PIC and VEX Cortex.

1. To use the VEX Motor Controller 29, plug the 3-wire end into one of the MOTOR ports on your VEX PIC or VEX Cortex Microcontroller.

2. Connect the other end of the VEX Motor Controller to the 2-wire Motor. Be sure to align the black and red wires as shown.

3. Motors connected to your robot using the VEX Motor Controllers are programmed using the same commands and power levels as the 3-wire motors.

#pragma config(Motor, port2, rightMotor, tmotorNormal, openLoop, reversed)
#pragma config(Motor, port3, leftMotor, tmotorNormal, openLoop)
//*!!Code automatically generated by ‘ROBOTC’ configuration wizard !!*//
task main()
{
//Move forward at full speed for 2 seconds
motor[rightMotor] = 127; //Turn on the right motor at full power
motor[leftMotor] = 127; //Turn on the left motor at full power
wait1Msec(2000); //Wait here for 2000 milliseconds
//Stop for 1 second
motor[rightMotor] = 0; //Turn off the right motor
motor[leftMotor] = 0; //Turn off the left motor
wait1Msec(1000); //Wait here for 1000 milliseconds
//Move in reverse at half speed for 2 seconds
motor[rightMotor] = -63; //Reverse the right motor at half power
motor[leftMotor] = -63; //Reverse the left motor at half power
wait1Msec(2000); //Wait here for 2000 milliseconds
}

Building Tip:
To prevent the 2-wire Motor and Motor Controller wires from accidentally separating while the robot is running, use the supplied wire tie to secure the two ends, along with any excess wire.

For more help using your VEX Cortex, check out the VEX Cortex Video Trainer.

Written by Jesse Flot

January 7th, 2011 at 4:51 pm