Recently my team has started using RobotC so we could use a Smart Motor control to keep our motors from dying. But after spending a few weeks we have got our Operator control to work but our Autonomous is not working, it is being very odd. It will only run for less than a sec (even though it should go longer). Anyone have any ideas? Any help would be appreciated.
#pragma config(Motor, port2, leftMotor2, tmotorVex393_MC29, openLoop, reversed, driveLeft)
#pragma config(Motor, port3, rightMotor3, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port4, leftMotor4, tmotorVex393_MC29, openLoop, reversed, driveLeft)
#pragma config(Motor, port5, rightMotor5, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port6, Claw, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, ArmH, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, ArmL, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma platform(VEX2)
#pragma competitionControl(Competition)
#include "SmartMotorLib.c"
#include "Vex_Competition_Includes.c"
void pre_auton()
{
bStopTasksBetweenModes = true;
SmartMotorsInit();
SmartMotorRun();
}
task autonomous()
{
motor[leftMotor2] = 127;
motor[rightMotor3] = 127;
motor[leftMotor4] = 127;
motor[rightMotor5] = 127;
wait1Msec(2000);
}
task usercontrol()
{
while (true)
{
SetMotor( leftMotor2, vexRT Ch2 ] );
SetMotor( rightMotor3, vexRT Ch3 ] );
SetMotor( leftMotor4, vexRT Ch2 ] );
SetMotor( rightMotor5, vexRT Ch3 ] );
buttonControl(ArmH,Btn5D,Btn5U,127);
buttonControl(ArmL,Btn5D,Btn5U,127);
buttonControl(Claw,Btn6U,Btn6D,127);
}
}