Hi guys, I am a new programmer and I need help with my driver control program. I am trying to program my chain bar and it is not working when I program it to the control but it works when I program it directly to the cortex. We have a brand new cortex, controller, motors and motor controllers. We also checked for connection issues but that doesn’t seem to be the problem. Any help is appreciated!
#pragma config(Motor, port2, IntakeR, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port3, IntakeL, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port4, driveR, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port5, driveL, tmotorVex393HighSpeed_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
void mobilelift(int speed)
{
motor[IntakeL] = speed;
motor[IntakeR] = speed;
}
//drive right void
void DriveLeft (int speed)
{
motor[driveL] = speed;
}
//drive left void
void DriveRight (int speed)
{
motor[driveR] = speed;
}
task main(){
while(true){
//Remote Control
//For drive Right
{
DriveRight(vexRT[Ch3]);
//For drive Left
DriveLeft(vexRT[Ch2]);
}
//For mobile
if (vexRT[Btn7DXmtr2] == true)
{
mobilelift(120);
}
else if (vexRT[Btn7UXmtr2] == true)
{
mobilelift(-120);
}
else
{
mobilelift(0);
}
}
}