-
Notifications
You must be signed in to change notification settings - Fork 1
Implementation
To implement correctly, create a variable for your motor power. For example, int motorpower; and set your intended value to motorpower. Then set your motor to that variable and post it to the library.
int motorpower;
motorpower = 127;
motor[port1] = motorpower;
AR_GenerateMotorPower(port1,motorpower);AR_BEGINSegment goes at the top of your while loop for driver control. It does all of the things necessary at the beginning of the loop.
while(true){
AR_BEGINSegment();AR_GenerateMotorPower adds the motor power to the queue. You have one of these for each motor
motor[leftBack]=leftpower; //leftpower has been previously set
AR_GenerateMotorPower(leftBack,leftpower); //leftBack is defined as a motor in the Motor and Sensor SetupAR_ENDSegment does all of the final calculation and debug log printing at the end of your while loop. It should be the very last thing in your loop
AR_ENDSegment();
}If everything is set up properly, you should be able to drive your robot with your joystick plugged into the computer via the wireless downloader, and the code should appear in the debug stream
-
A computer with RobotC
-
Vex Cortex
-
Vex Joystick and Vexnets