Ok we need a little help… a lot actually so we have a comp tomorrow and our forebers aren’t functioning. They go down but not up. the moters can hold it up because our anti gav is in effect. Basically everything works except for lifting. We have a simple build fo it. we have 4 motors 2 red 2 green each with a piece of metal attached then they are all linked up correctly. If anyone can help please do this is urgent. our code looks like this/----------------------------------------------------------------------------/
/* /
/ Module: main.cpp /
/ Author: VEX /
/ Created: Thu Sep 26 2019 /
/ Description: Competition Template /
/ /
/----------------------------------------------------------------------------*/
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// TopRightForebar motor 12
// TopLeftForebar motor 11
// RightMotor motor 13
// LeftMotor motor 16
// RightForebar motor 14
// LeftForebar motor 15
// RightFlip motor 19
// LeftFlip motor 18
// ---- END VEXCODE CONFIGURED DEVICES ----
#include “vex.h”
using namespace vex;
competition Competition;
// define your global instances of motors and other devices here
void StopForebars(){
TopLeftForebar.stop();
TopRightForebar.stop();
LeftForebar.stop();
RightForebar.stop();
}
void pre_auton(void) {
vexcodeInit();
// All activities that occur before the competition starts
}
void StopUArm(){
RightForebar.stop();
LeftForebar.stop();
}
//auton code:
void autonomous(void) {
LeftFlip.spinFor(reverse, 2, turns, false);
RightFlip.spinFor(reverse, 2, turns, false);//turning out the bars
RightMotor.setVelocity(100, percent);
LeftMotor.setVelocity(100, percent);//making motors go fast
RightMotor.spinFor(forward, 3.3, turns, false);
LeftMotor.spinFor(forward, 3.3, turns);//going forward
LeftFlip.spinFor(forward, 1, turns, false);
RightFlip.spinFor(forward, 1, turns);//turning the goal up
RightMotor.spinFor(reverse, 2.8, turns, false);
LeftMotor.spinFor(reverse, 2.8, turns);//moving backwards
RightMotor.spinFor(forward, 180, degrees);
LeftFlip.spinFor(reverse, 2, turns, false);
RightFlip.spinFor(reverse, 2, turns);//dropping the goal
RightMotor.spinFor(reverse, 0.3, turns, false);
LeftMotor.spinFor(reverse, 0.3, turns);//go backwards
LeftMotor.spinFor(reverse, 110, degrees);//turn to get middle goal
RightMotor.spinFor(forward, 4, turns, false);
LeftMotor.spinFor(forward, 4, turns);//going forward
LeftFlip.spinFor(forward, 1, turns, false);
RightFlip.spinFor(forward, 1, turns);//turning the goal up
RightMotor.spinFor(reverse, 2.8, turns, false);
LeftMotor.spinFor(reverse, 70, degrees);
RightMotor.spinFor(forward, 1, turns, false);
LeftMotor.spinFor(forward, 1, turns, false);//moving towards the seesaw
LeftFlip.spinFor(reverse, 1, turns, false);
RightFlip.spinFor(reverse, 1, turns);//turning the goal down
}
//driver code:
void usercontrol(void) {
TopRightForebar.setVelocity(100, percent);
TopLeftForebar.setVelocity(100, percent);
RightForebar.setVelocity(100, percent);
LeftForebar.setVelocity(100, percent);
float ForwardDirection = Controller1.Axis3.value();
float SidewaysDirection = Controller1.Axis4.value();
bool moving = false;
while(1) {
ForwardDirection = Controller1.Axis3.value();
SidewaysDirection = Controller1.Axis4.value();
moving = false;
while (Controller1.ButtonL1.pressing()){
TopRightForebar.spin(forward);
TopLeftForebar.spin(forward);
RightForebar.spin(forward);
LeftForebar.spin(forward);
moving = true;
}
while (Controller1.ButtonL2.pressing()){
TopRightForebar.spin(reverse);
TopLeftForebar.spin(reverse);
RightForebar.spin(reverse);
LeftForebar.spin(reverse);
moving = true;
}
while (moving == false) {
TopRightForebar.spin(forward, 10, percent);
TopLeftForebar.spin(forward, 10, percent);
RightForebar.spin(forward, 10, percent);
LeftForebar.spin(forward, 10, percent);
}
if (Controller1.ButtonUp.pressing()){
RightFlip.setVelocity(100, percent);
LeftFlip.setVelocity(100, percent);
RightFlip.spin(forward);
LeftFlip.spin(forward);
} else if (Controller1.ButtonDown.pressing()){
RightFlip.spin(reverse);
LeftFlip.spin(reverse);
} else{
RightFlip.spin(forward, 1, percent);
LeftFlip.spin(forward, 1, percent);
}
LeftMotor.spin(directionType::fwd, ForwardDirection + SidewaysDirection, percent);
RightMotor.spin(directionType::fwd, ForwardDirection-SidewaysDirection, percent);
}
}
int main(){
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
pre_auton();
while (true) {
wait(100, msec);
}
}