Our arm 1 is not working. Can someone please help?
using namespace vex;
vex::motor Frontleftmotor (vex::PORT1, vex::gearSetting::ratio18_1, false);
vex::motor Frontrightmotor (vex::PORT2, vex::gearSetting::ratio18_1, true);
vex::motor Backleftmotor (vex::PORT3, vex::gearSetting::ratio18_1, false);
vex::motor Backrightmotor (vex::PORT4, vex::gearSetting::ratio18_1, true);
vex::motor Arm1 (vex::PORT5, vex::gearSetting::ratio18_1, true);
vex::motor Arm2 (vex::PORT6, vex::gearSetting::ratio18_1, true);
vex::motor Claw1 (vex::PORT7, vex::gearSetting::ratio18_1, true);
vex::motor Claw2 (vex::PORT8, vex::gearSetting::ratio18_1, true);
vex::motor Capflipper (vex::PORT9, 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);//(Axis1-Axis2)/2
Frontleftmotor.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct); //(Axis2+Axis1)/2
Frontrightmotor.spin(vex::directionType::fwd, Controller1.Axis2.value(), vex::velocityUnits::pct); //(Axis4+Axis3)/2
vex::task::sleep(20);
if(Controller1.ButtonX.pressing())
{
Arm1.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonX.pressing())
{
Arm1.stop();
}
else if (Controller1.ButtonB.pressing())
{
Arm1.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonB.pressing())
{
Arm1.stop();
}
if(Controller1.ButtonX.pressing())
{
Arm2.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
vex::task::sleep(20);
}
if(!Controller1.ButtonX.pressing())
{
Arm2.stop();
}
else if (Controller1.ButtonB.pressing())
{
Arm2.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
vex::task::sleep(20);
}
if(!Controller1.ButtonB.pressing())
{
Arm2.stop();
}
if(Controller1.ButtonR1.pressing())
{
Claw1.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonR1.pressing())
{
Claw1.stop();
}
else if (Controller1.ButtonR2.pressing())
{
Claw1.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonR2.pressing())
{
Claw1.stop();
}
if(Controller1.ButtonR1.pressing())
{
Claw2.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonR1.pressing())
{
Claw2.stop();
}
else if(Controller1.ButtonR2.pressing())
{
Claw2.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonR2.pressing())
{
Claw2.stop();
}
if(Controller1.ButtonL1.pressing())
{
Capflipper.spin(vex::directionType::fwd, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonL1.pressing())
{
Capflipper.stop();
}
else if(Controller1.ButtonL2.pressing())
{
Capflipper.spin(vex::directionType::rev, 100, vex::velocityUnits::pct);
}
if(!Controller1.ButtonL2.pressing())
{
Capflipper.stop();
}
}
}