sure this is the entire driver control
void usercontrol(void) {
// User control code here, inside the loop
while (1) {
// This is the main execution loop for the user control program.
// Each time through the loop your program should update motor + servo
// values based on feedback from the joysticks.
// ........................................................................
// Insert user code here. This is where you use the joystick values to
// update your motors, etc.
// normal drive
// use cubic function
while(sped==false && manual == false){
// speed is set to joystick values
LeftA.setVelocity(Controller1.Axis3.value()^3/100,percent);
LeftB.setVelocity(Controller1.Axis3.value()^3/100,percent);
RightA.setVelocity(Controller1.Axis2.value()^3/100,percent);
RightB.setVelocity(Controller1.Axis2.value()^3/100,percent);
LeftA.spin(forward);
LeftB.spin(forward);
RightA.spin(forward);
RightB.spin(forward);
// R1 grabs goal with claw
Controller1.ButtonR2.pressed(grabby1);
// X lets go of goal with claw
// stacks goal on platform with Y
Controller1.ButtonR1.pressed(Stack);
// A raises goal
Controller1.ButtonA.pressed(lifty);
// lift down with B
Controller1.ButtonB.pressed(lifty2);
// spins goal lift down with Down
Controller1.ButtonDown.pressed(Goalliftdown);
// Left raises goal lift
Controller1.ButtonLeft.pressed(Goalliftup);
// spins conveyor
if(Controller1.ButtonL1.pressing()){
//spins other direction
conveyor.spin(forward,80,percent);
}
else if(Controller1.ButtonL2.pressing()){
conveyor.spin(reverse,80,pct);
}
else{
// stops the conveyor from spinning
conveyor.stop(hold);
conveyor.setVelocity(0, percent);
}
//speed change using an if statement
Controller1.ButtonY.pressed(spedy);
// turns on manual
Controller1.ButtonRight.pressed(manualOn);
}
//speed change and no manual
while(sped==true && manual == false){
LeftA.setVelocity(Controller1.Axis3.value()*2,percent);
LeftB.setVelocity(Controller1.Axis3.value()*2,percent);
RightA.setVelocity(Controller1.Axis2.value()*2,percent);
RightB.setVelocity(Controller1.Axis2.value()*2,percent);
LeftA.spin(forward);
LeftB.spin(forward);
RightA.spin(forward);
RightB.spin(forward);
Controller1.ButtonR2.pressed(grabby1);
// R2 is used for speed change use up
// right can be manual
//Controller1.ButtonR2.pressed(grabby2);
// lift up
Controller1.ButtonA.pressed(lifty);
// lift down
Controller1.ButtonB.pressed(lifty2);
// spins goal lift up
Controller1.ButtonDown.pressed(Goalliftdown);
Controller1.ButtonLeft.pressed(Goalliftup);
if(Controller1.ButtonL2.pressing()){
//spins other direction
// find out what problem with reverse is
conveyor.spin(reverse,80,pct);
}
else if(Controller1.ButtonL1.pressing()){
// strts coveyor spinning
conveyor.spin(forward,80,pct);
}
else{
// stops the conveyor from spinning
conveyor.stop(hold);
conveyor.setVelocity(0, percent);
}
//speed change
Controller1.ButtonY.pressed(truespedy);
Controller1.ButtonRight.pressed(manualOn);
}
// speed is normal with Manual
while(sped==false && manual == true){
LeftA.setVelocity(Controller1.Axis3.value()^3/100,percent);
LeftB.setVelocity(Controller1.Axis3.value()^3/100,percent);
RightA.setVelocity(Controller1.Axis2.value()^3/100,percent);
RightB.setVelocity(Controller1.Axis2.value()^3/100,percent);
LeftA.spin(forward);
LeftB.spin(forward);
RightA.spin(forward);
RightB.spin(forward);
if(Controller1.ButtonDown.pressing()){
Glift.spin(reverse,80,pct);
}
// spin the goal lift down after setting velocity.
else if(Controller1.ButtonLeft.pressing()){
Glift.spin(forward,80,pct);
}
else{
Glift.setVelocity(0, percent);
Glift.stop(hold);
}
// setting controls for lift
if(Controller1.ButtonA.pressing()){
// lift goes up
Lift.spin(reverse,80,pct);
}
else if(Controller1.ButtonB.pressing()){
//lift goes down
Lift.spin(forward,80,pct);
}
else{
// lift is still.
Lift.setVelocity(0, percent);
Lift.stop(hold);
}
if(Controller1.ButtonY.pressing()){
claw.spin(forward,80,pct);
}
else if(Controller1.ButtonX.pressing()){
claw.spin(reverse,80,pct);
}
else{
claw.stop(hold);
claw.setVelocity(0, percent);
}
if(Controller1.ButtonL2.pressing()){
//spins other direction
// find out what problem with reverse is
conveyor.spin(reverse,80,pct);
}
else if(Controller1.ButtonL1.pressing()){
// strts coveyor spinning
conveyor.spin(forward,80,pct);
}
else{
// stops the conveyor from spinning
conveyor.stop(hold);
conveyor.setVelocity(0, percent);
}
//speed change
Controller1.ButtonR2.pressed(spedy);
Controller1.ButtonRight.pressed(manualOff);
}
// speed is fast with manual
while(sped==true && manual == true){
LeftA.setVelocity(Controller1.Axis3.value()*2,percent);
LeftB.setVelocity(Controller1.Axis3.value()*2,percent);
RightA.setVelocity(Controller1.Axis2.value()*2,percent);
RightB.setVelocity(Controller1.Axis2.value()*2,percent);
LeftA.spin(forward);
LeftB.spin(forward);
RightA.spin(forward);
RightB.spin(forward);
if(Controller1.ButtonDown.pressing()){
Glift.spin(reverse,80,pct);
}
// spin the goal lift down after setting velocity.
else if(Controller1.ButtonLeft.pressing()){
Glift.spin(forward,80,pct);
}
else{
Glift.setVelocity(0, percent);
Glift.stop(hold);
}
// setting controls for lift
if(Controller1.ButtonA.pressing()){
// lift goes up
Lift.spin(reverse,80,pct);
}
else if(Controller1.ButtonB.pressing()){
//lift goes down
Lift.spin(forward,80,pct);
}
else{
// lift is still.
Lift.setVelocity(0, percent);
Lift.stop(hold);
}
if(Controller1.ButtonY.pressing()){
claw.spin(forward,80,pct);
}
else if(Controller1.ButtonX.pressing()){
claw.spin(reverse,80,pct);
}
else{
claw.stop(hold);
claw.setVelocity(0,pct);
}
if(Controller1.ButtonL2.pressing()){
//spins other direction
// find out what problem with reverse is
conveyor.spin(reverse,80,pct);
}
else if(Controller1.ButtonL1.pressing()){
// strts coveyor spinning
conveyor.spin(forward,80,pct);
}
else{
// stops the conveyor from spinning
conveyor.stop(hold);
conveyor.setVelocity(0, percent);
}
//speed change
Controller1.ButtonR2.pressed(truespedy);
Controller1.ButtonRight.pressed(manualOff);
}