Our code is this, But for some reasons our code won’t work 100% the arm movement and the drive will not work but the claw movement is the only thing that works, How can we fix this?
armplusdrivecode.c
#pragma config(Motor, port1, armR, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, right1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, right2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, right3, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, left1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, left2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, left3, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, clawR, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port9, clawL, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, armL, tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(1==1)
{
//right side
motor[right1]=vexRT[Ch3]/-1;
motor[right2]=vexRT[Ch3]/-1;
motor[right3]=vexRT[Ch3]/-1;
//left side
motor[left1]=vexRT[Ch2]/1;
motor[left2]=vexRT[Ch2]/1;
motor[left3]=vexRT[Ch2]/1;
//arm up and down
if (vexRT[Btn6U] == 1)
{
startMotor(armL,127);
startMotor(armR,127);
}
else if (vexRT[Btn6D] == 1)
{
startMotor(armL,-127);
startMotor(armR,-127);
}
else
{
stopMotor(armL);
stopMotor(armR);
}
//claw up and down
if (vexRT[Btn5U] == 1)
{
startMotor(clawL,127);
startMotor(clawR,127);
}
else if (vexRT[Btn5D] == 1)
{
startMotor(clawL,-127);
startMotor(clawR,-127);
}
else
{
stopMotor(clawL);
stopMotor(clawR);
}
}
}
Edit
The code doesn’t work nothing is working.