I’d like to ask if my code is shown to be formatted correctly, and will run correctly once ready for competition.
#pragma config(Motor, port1, WheelRight, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, WheelLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ClawMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ClawMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, LeverMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, LeverMotor1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, WheelLeft1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, WheelRight1, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
#pragma platform(VEX)
//Competition Control and Competition Run Time Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(105)
#include “Vex_Competition_Includes.c”
void pre_auton()
{
bStopTasksBetweenModes = true;
}
task autonomous()
{
//Autonomous place-holder (test code)
if(vexRT[Btn7U])
{
startTask(autonomous);
//Test Code (Do NOT use)
motor[WheelRight] = -127;
motor[WheelLeft] = 127;
wait1Msec(1000);
motor[WheelRight] = 127;
motor[WheelLeft] = -127;
wait1Msec(1000);
motor[WheelRight] = 0;
motor[WheelLeft] = 0;
AutonomousCodePlaceholderForTesting();
}
}
task usercontrol()
{
if(vexRT [Btn7D] == 0)
{
startTask(usercontrol);
while (true)
{
motor[WheelLeft] = vexRT[Ch1];
motor[WheelRight1] = vexRT[Ch2];
motor[WheelLeft1] = vexRT[Ch4];
motor[WheelRight] = vexRT[Ch3];
{
motor(WheelLeft) = 100;
}
{
motor(WheelLeft) = 100;
}
{
motor(WheelLeft1) = 100;
}
{
motor(WheelLeft1) = 100;
}
{
motor(WheelRight) = 100;
}
{
motor(WheelRight) = 100;
}
{
motor(WheelRight1) = 100;
}
{
motor(WheelRight1) = 100;
}
if(vexRT[Btn6D] == 1)
{
motor(LeverMotor) = -120;
motor(LeverMotor1) = -120;
}
else if(vexRT(Btn6U) == 1)
{
motor(LeverMotor) = 120;
motor(LeverMotor1) = 120;
}
else
{
motor(LeverMotor) = 0;
motor(LeverMotor1) = 0;
}
if(vexRT(Btn5U) == 1)
{
motor(ClawMotor) = 120;
motor(ClawMotor1) = 120;
}
else if(vexRT(Btn5D) == 1)
{
motor(ClawMotor) = -120;
motor(ClawMotor1) = -120;
}
else
{
motor(ClawMotor) = 0;
motor(ClawMotor1) = 0;
//set timing chain at same time
}
}
}
}