Code: #pragma config(Motor, port1, leftWheel, tmotorVex393, openLoop, reversed) #pragma config(Motor, port4, frontWheel, tmotorVex393, openLoop, reversed) #pragma config(Motor, port5, backWheel, tmotorVex393, openLoop) #pragma config(Motor, port7, tropheeMotor, tmotorVex393, openLoop) #pragma config(Motor, port10, rightWheel, tmotorVex393, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() {
//Create "deadzone" variables. Adjust threshold value to increase/decrease deadzone int X2 = 0, Y1 = 0, X1 = 0, threshold = 15;
//Loop Forever while(1 == 1) { //Create "deadzone" for Y1/Ch3 if(abs(vexRT[Ch3]) > threshold) { Y1 = vexRT[Ch3]; } else { Y1 = 0; }
//Create "deadzone" for X1/Ch4 if(abs(vexRT[Ch4]) > threshold) { X1 = vexRT[Ch4]; } else { X1 = 0; }
//Create "deadzone" for X2/Ch1 if(abs(vexRT[Ch1]) > threshold) { X2 = vexRT[Ch1]; } else { X2 = 0; }
//Remote Control Commands motor[leftWheel] = Y1 + X2; motor[rightWheel] = Y1 - X2; motor[frontWheel] = X1 + X2; motor[backWheel] = X1 - X2; } }
|