Finally after finding the correct place to post my code I have a code that I would like double checked please.
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, dgtl1, LimitUp, sensorTouch)
#pragma config(Sensor, dgtl2, Button, sensorTouch)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Motor, port1, FrontLeft, tmotorVex393_HBridge, openLoop, reversed, driveLeft)
#pragma config(Motor, port2, FrontRight, tmotorVex393_MC29, openLoop, reversed, driveRight)
#pragma config(Motor, port3, BackLeft, tmotorVex393_MC29, openLoop, reversed, driveLeft)
#pragma config(Motor, port4, BackRight, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port5, BandIntake, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ConveyorIntake, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, MotorLeft, tmotorVex393_MC29, PIDControl, encoderPort, I2C_1)
#pragma config(Motor, port8, MotorRight, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, MotorMiddle, tmotorVex393_MC29, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
//Variable List for Track encoder calculations.
float diameter=1.5;//Diameter of gear in inches.
float circumference=diameter*PI;//Circumfrence of Gear in inches.
float track=4.0;//Length of track in inches.
float spins=track/circumference;//Number of rotations needed to cover track.
float oneshot=spins*(4/5);//Length needed in order to get to skipped gear. 1/5 of the gear is filed away for skipping mechanism.
float ticks=oneshot*627;//Length turned into degrees for motor encounts.
void autonomousmode()//Autonomous function to avoid powercycling.
{
//setMultipleMotors(127,BandIntake,ConveyorIntake);
motor[BandIntake]=127;
motor[ConveyorIntake]=127;
motor[MotorLeft]=127;
motor[MotorMiddle]=127;
motor[MotorRight]=127;
//setMultipleMotors(127,MotorLeft,MotorRight,MotorMiddle);
if(vexRT[Btn7U]==1)//Breaks autonomous function.
//stopAllMotors();
motor[BandIntake]=0;
motor[ConveyorIntake]=0;
motor[MotorLeft]=0;
motor[MotorMiddle]=0;
motor[MotorRight]=0;
}
void shot()
{
//Plays sound to indicate warning for shot.
playSound(soundLowBuzz);
//Sets Intake Motors to full speed.
//setMultipleMotors(127,BandIntake,ConveyorIntake);
motor[BandIntake]=127;
motor[ConveyorIntake]=127;
if(SensorValue[LimitUp]==1)//if Limit switch on top of intake is tripped, fire run motors for one shot equivilant
{
resetMotorEncoder(MotorLeft);
if(getMotorEncoder(MotorLeft)<ticks)//Runs motors until encoder is equal to length needed to fire shot.
{
//setMultipleMotors(127,MotorLeft,MotorMiddle,MotorRight,);
motor[MotorLeft]=127;
motor[MotorMiddle]=127;
motor[MotorRight]=127;
}
else//resets motors to 0 once target is met.
{
//setMultipleMotors(0,MotorLeft,MotorMiddle,MotorRight,);
motor[MotorLeft]=0;
motor[MotorMiddle]=0;
motor[MotorRight]=0;
}
}
}
task main()
{
//Basic Arcade Chassis Control
arcadeControl(Ch3,Ch4);
while(true)//Main while user control loop.
{
if(vexRT[Btn8U]==1)//If button is hit, and held, intake is initiated.
{
//setMultipleMotors(127,BandIntake,ConveyorIntake);
motor[BandIntake]=127;
motor[ConveyorIntake]=127;
}
else
{
//setMultipleMotors(0,BandIntake,ConveyorIntake);
motor[BandIntake]=0;
motor[ConveyorIntake]=0;
}
if(vexRT[Btn5U]==1)//If button is hit, initiate one shot. Mainly used for Human-feeding.
shot();
}
if(vexRT[Btn5D]==1)//Override button for continuous shooting when held down during user-control. NOT AUTONOMOUS!
{
//setMultipleMotors(127,MotorLeft,MotorMiddle,MotorRight,);
motor[MotorLeft]=127;
motor[MotorMiddle]=127;
motor[MotorRight]=127;
}
else
{
//setMultipleMotors(0,MotorLeft,MotorMiddle,MotorRight,);
motor[MotorLeft]=0;
motor[MotorMiddle]=0;
motor[MotorRight]=0;
}
if(SensorValue[Button]==1)//User-Controlled autonomous initiation in order to avoid power cycling.
autonomousmode();
}
I was also confused as to why setMultipleMotors was not a command and weather the waitUntil command was as well. I see them turn blue when I type them but i’m confused as to weather it’s a platform issue or a lack of knowledge issue. I’ve also got a second code that is for my flywheel which I’d like my code double checked once more. Thanks again everyone.