#pragma config(Sensor, dgtl2, pistonleftshooter, sensorDigitalOut)
#pragma config(Sensor, dgtl3, pistonrightshooter, sensorDigitalOut)
#pragma config(Sensor, dgtl4, pistonshooterlevel, sensorDigitalOut)
#pragma config(Sensor, dgtl5, liftleft, sensorNone)
#pragma config(Sensor, dgtl6, leftright, sensorNone)
#pragma config(Motor, port1, leftLiftMotor, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, Rightdrivemotor, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port3, Leftdrivemotor, tmotorVex393_MC29, openLoop, reversed, driveLeft)
#pragma config(Motor, port4, leftIntake, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, rightIntake, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, LefttopSMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, LeftbottomSMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, RighttopSMotor, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port9, RightbottomSMotor, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, rightLiftMotor, tmotorVex393_HBridge, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
while(1 == 1)
{
int speed;
speed = 127; //Shooter Speed
//Right side of the robot is controlled by the right joystick, Y-axis
motor[Rightdrivemotor] = vexRT[Ch2];
//Left side of the robot is controlled by the left joystick, Y-axis
motor[Leftdrivemotor] = vexRT[Ch3];
if(vexRT[Btn6D] == 1)
{
motor[LefttopSMotor] = speed;
SensorValue[pistonleftshooter] = 1; // …activate the solenoid.
SensorValue[pistonrightshooter] = 1; // …activate the solenoid.
SensorValue[pistonshooterlevel] = 1;
}
else if(vexRT[Btn5D] == 1)
{
motor[LefttopSMotor] = -speed;
}
else
{
motor[LefttopSMotor] = 0;
SensorValue[pistonleftshooter] = 0; ////long shot activated by brandon montano
SensorValue[pistonrightshooter] = 0; ////long shot activated by brandon montano
SensorValue[pistonshooterlevel] = 0;
}
if(vexRT[Btn6D] == 1)
{
motor[LeftbottomSMotor] = speed;
}
else if(vexRT[Btn5D] == 1)
{
motor[LeftbottomSMotor] = -speed;
}
else
{
motor[LeftbottomSMotor] = 0;
}
if(vexRT[Btn6D] == 1)
{
motor[RightbottomSMotor] = speed;
}
else if(vexRT[Btn5D] == 1)
{
motor[RightbottomSMotor] = -speed;
}
else
{
motor[RightbottomSMotor] = 0;
}
if(vexRT[Btn6D] == 1)
{
motor[RighttopSMotor] = speed;
}
else if(vexRT[Btn5D] == 1)
{
motor[RighttopSMotor] = -speed;
}
else
{
motor[RighttopSMotor] = 0;
}
if(vexRT[Btn6DXmtr2] == 1)
{
motor[rightIntake] = (127);
}
else if(vexRT[Btn8DXmtr2] == 1)
{
motor[rightIntake] = (-127);
}
else
{
motor[rightIntake] = 0;
}
if(vexRT[Btn6DXmtr2] == 1)
{
motor[leftIntake] = (127);
}
else if(vexRT[Btn8DXmtr2] == 1)
{
motor[leftIntake] = (-127);
}
else
{
motor[leftIntake] = 0;
}
// Don’t hog the cpu
wait1Msec(25);
}// end of while loop
}// end of task main