Code: #pragma config(Motor, port3, rightWheels, tmotorVex393_MC29, openLoop) #pragma config(Motor, port4, leftWheels, tmotorVex393_MC29, openLoop, reversed) #pragma config(Motor, port5, claw, tmotorVex393_MC29, openLoop) #pragma config(Motor, port6, crane, tmotorVex393_MC29, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main(){ while(1 == 1){ motor[leftWheels] = vexRT[Ch3]; motor[rightWheels] = vexRT[Ch2];
if(vexRT[Btn5D] && vexRT[Btn5U]){ motor[crane] = 0; } else if(vexRT[Btn5D]){ motor[crane] = 127; } else if(vexRT[Btn5U]){ motor[crane] = -127; } else { motor[crane] = 0; }
if(vexRT[Btn6D] && vexRT[Btn6U]){ motor[claw] = 0; } else if(vexRT[Btn6D]){ motor[claw] = 127; } else if(vexRT[Btn6U]){ motor[claw] = -127; } else { motor[claw] = 0; } } } |