Why is my Arcade Control Not Working!?!?!?!?!?!?!?!?

 while (true) {          
        LeftMotor.spin(directionType::fwd, (Controller1.Axis3.value() + Controller1.Axis4.value())/2, velocityUnits::pct);
        RightMotor.spin(directionType::fwd, (Controller1.Axis3.value() - Controller1.Axis4.value())/2, velocityUnits::pct);

So that’s a snip of my code, (the arcade control). Everything else works fine, but the arcade control just doesn’t work! Does anyone know why?

Pls, does anyone know? I have been working on it for weeks, but can’t find the problem. Any help would be appreciated

I’m not entirely sure, but my teammate (technically on the A team) had a similar issue and said something about limiting it to a max of 127 or something like that. When we went above that our robot went rogue and shot one of the lenses out of my other teammate’s (also A team) glasses!

There’s nothing fundamentally wrong with the code you posted, the only way to know would be to see the whole project. What exactly doesn’t work ? No motor movement at all ?

ArmClawController.vex (5 KB)

that is my code

I’m probably going to change it by the second comp tho

and yes @jpearman, motors don’t move.

You have three while(true){} loops. The second is inside the first. So you run through checking your controller axes a single time and then get stuck inside the second while(true){}. The third does the same to the second.

Move

LeftMotor.spin(directionType::fwd, Controller1.Axis3.value(), velocityUnits::pct);         
RightMotor.spin(directionType::fwd, Controller1.Axis4.value(), velocityUnits::pct); 

down to the lower while(true){}.

Move

MotoryArmie.spin(directionType::fwd, Controller1.Axis2.value(), velocityUnits::pct);         
MotoryArmie2.spin(directionType::fwd, Controller1.Axis2.value(), velocityUnits::pct);          
task::sleep(20);

up to the second while(true){}, with the rest of the stuff.

Delete the first and third while(true){, the #include “robot-config.h” inside of the first one (you already have this at the top), the last task::sleep(20);, and their closing }s.

Then you should be good.

LeftMotor.spin(directionType::fwd, Controller1.Axis3.value(), velocityUnits::pct);         
RightMotor.spin(directionType::fwd, Controller1.Axis4.value(), velocityUnits::pct); 

But for this part, would that still be arcade?

So, would this code work for real competition driver control?
7517J CODE.vex (10.5 KB)

No, you still had multiple while loops and seemed to have duplicated robot config somehow.
Have a look at this (I added back your arcade code)
7517J CODE_rev1.vex (9.5 KB)

Oh, ok. I thought I had fixed that. Thanks @jpearman for all the help and support :slight_smile:

I know I am asking a lot of questions, but will this code work if a competition switch is turned to driver control? Or is it there a different line that i have to put in? I’m really sorry for all of these questions :frowning:
But thanks everyone for all the help!