Can someone plz test my code I do not have my brain with me right now (by brain I mean the v5 brain).
#include “robot-config.h”
vex::motor Backleftmotor (vex::PORT1, vex::gearSetting::ratio18_1,true);
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);
int main()
{
while(true)
{
Backleftmotor.spin(vex::directionType::fwd, Controller1.Axis3.value()/2, vex::velocityUnits::pct); //Tank Control : Motor runs at half speed
Backrightmotor.spin(vex::directionType::fwd, Controller1.Axis2.value()/2, vex::velocityUnits::pct); //Tank Control : Motor runs at half speed
}
if(Controller1.ButtonX.pressing())
{
Arm1.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
} //This is the code for arm1
else if(Controller1.ButtonB.pressing())
{
Arm1.spin(vex::directionType::rev,100,vex::velocityUnits::pct);
}
//This is the code for Arm2
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);
} //This is the code for Claw 1
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);
}
//This is the code for Claw2
else if(Controller1.ButtonR2.pressing())
{
Claw2.spin(vex::directionType::rev,100,vex::velocityUnits::pct);
}
}