I do not have my V5 brain with me. Can someone plz test this code?

using namespace vex;

vex::motor Backleftmotor (vex::PORT1, vex::gearSetting::ratio18_1, false);
vex::motor Backrightmotor (vex::PORT2, vex::gearSetting::ratio18_1, true);
vex::motor Arm1 (vex::PORT3, vex::gearSetting::ratio18_1, true);
vex::motor Arm2 (vex::PORT4, vex::gearSetting::ratio18_1, true);
vex::motor Claw1 (vex::PORT5, vex::gearSetting::ratio18_1, true);
vex::motor Claw2 (vex::PORT6, vex::gearSetting::ratio18_1, true);
vex::motor Capflipper (vex::PORT4, vex::gearSetting::ratio18_1, true);
#include “robot-config.h”

int main() {

while(true) {
    Backleftmotor.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct); //(Axis3+Axis4)/2
    Backrightmotor.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct);//(Axis3-Axis4)/2
    
    vex::task::sleep(20); 


if(Controller1.ButtonX.pressing())

{
Arm1.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
}

else if (Controller1.ButtonB.pressing())
{
    Arm1.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
}
    
   if(Controller1.ButtonX.pressing())
   {
       Arm2.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
   }
    else if (Controller1.ButtonB.pressing())
    {
        Arm2.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
    }
    if(Controller1.ButtonR1.pressing())
    {
        Claw1.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
    }
    else if (Controller1.ButtonR2.pressing())
    {
        Claw1.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
    }
    if(Controller1.ButtonR1.pressing())
    {
        Claw2.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
    }
    else if(Controller1.ButtonR2.pressing())
    {
        Claw2.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
    }
    if(Controller1.ButtonL1.pressing())
    {
        Capflipper.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
    }
    else if(Controller1.ButtonL2.pressing())
    {
        Capflipper.spin(vex::directionType::rev, 100, vex::velocityUnits::pct)
    }
    
}

}

I don’t know about your current situation, but I want to make this clear - nobody is going to be able to test your code for you.
Your code is written for YOUR own robot, not anybody else’s. I could upload what you’ve posted here to my own robot and most likely nothing will happen. You haven’t even stated what the code should accomplish, so how would I even know if your code works?

1 Like

Looks good, you’ll probably have to wait till you have v5 to test it though, as your motor configuration will be different from anyone else.

I’ve tried to test it in the past, but I’m pretty sure I configured the robot wrong.