Skip to content

Commit

Permalink
V9
Browse files Browse the repository at this point in the history
  • Loading branch information
BeckerJason committed Mar 31, 2020
1 parent 06d1480 commit 724d3ec
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 118 deletions.
1 change: 0 additions & 1 deletion V8_24.v5code

This file was deleted.

1 change: 1 addition & 0 deletions V9_24_2.v5code
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":"V9_24_2","description":"Bug Fixes and Functionality Improvements","icon":"USER921x.bmp","version":"19.10.0715","sdk":"20191206_14_00_00","language":"cpp","competition":false,"files":[{"name":"include/vex.h","type":"File","specialType":""},{"name":"include/AllianceSelect.h","type":"File","specialType":""},{"name":"include/autonincludes.h","type":"File","specialType":""},{"name":"include/RedBlue1.h","type":"File","specialType":""},{"name":"include/Blue2.h","type":"File","specialType":""},{"name":"include/Blue3.h","type":"File","specialType":""},{"name":"include/Blue4.h","type":"File","specialType":""},{"name":"include/defines.h","type":"File","specialType":""},{"name":"include/pre_auton.h","type":"File","specialType":""},{"name":"include/Red1.h","type":"File","specialType":""},{"name":"include/Red2.h","type":"File","specialType":""},{"name":"include/Red3.h","type":"File","specialType":""},{"name":"include/Red4.h","type":"File","specialType":""},{"name":"include/usercontrol.h","type":"File","specialType":""},{"name":"include/Blue1.h","type":"File","specialType":""},{"name":"include/functions.h","type":"File","specialType":""},{"name":"include/VisionDef.h","type":"File","specialType":"vision_config"},{"name":"include/Blue5.h","type":"File","specialType":""},{"name":"include/ArcadeControl.h","type":"File","specialType":""},{"name":"include/Blue6.h","type":"File","specialType":""},{"name":"makefile","type":"File","specialType":""},{"name":"src/main.cpp","type":"File","specialType":""},{"name":"vex/mkenv.mk","type":"File","specialType":""},{"name":"vex/mkrules.mk","type":"File","specialType":""},{"name":"include","type":"Directory"},{"name":"src","type":"Directory"},{"name":"vex","type":"Directory"}],"device":{"slot":2,"uid":"276-4810"},"isExpertMode":true,"isExpertModeRC":true,"isVexFileImport":false,"robotconfig":[],"neverUpdate":null}
2 changes: 1 addition & 1 deletion compile_commands.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions include/AllianceSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "defines.h"
using namespace G;
#ifndef DEBUG //if DEBUG is defined earlier this section will not compile //screen 480x272

printscreen.suspend();



Expand Down Expand Up @@ -41,7 +41,7 @@ using namespace G;
Brain.Screen.drawRectangle(20, 1, 430, 300, vex::color::black);
selection = 1;
int select=0;
while(1)
/*while(1)
{
for(int i=1;i<=4;i++)
{
Expand Down Expand Up @@ -88,7 +88,8 @@ Brain.Screen.drawRectangle(180, 180, 120, 40, vex::color::white);
Brain.Screen.printAt(210,210, false, "SELECT");
if (select == 1 && Brain.Screen.pressing() == 0) { break; } //else if Touch within select box&& Selection >0 :: selection=3
wait(75);
}
wait(500);
}*/
printscreen.resume();
wait(1000);

#endif
38 changes: 34 additions & 4 deletions include/ArcadeControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ while (1)
StopDrive(hold); //Defend Position
}

else if (AutoRunning == 0 && (abs(ch3) > 10 || abs(ch1) > 10))
else if (AutoRunning == 0 && (abs(ch3) > 10 || abs(ch4) > 10))
{
FSpeed =ch3;
TSpeed =0.33*ch1;
TSpeed =0.33*ch4;
CubeTrack=off; ToCube=off;
run(LF, (FSpeed + TSpeed));
run(LM, (FSpeed + TSpeed));
Expand Down Expand Up @@ -82,7 +82,7 @@ while (1)
else {DontLiftStack=off;DontDropStack=off;}

//if (bL2==1){CubeTrack=on;}
if (bX){task cubeload (CubeLoad);}
if (bX){vex::task cubeload (CubeLoad);}
else if (bLeft){cubeload.suspend();}
if (bRight){vex::task stack (AutoStack);}
else if (bX){stack.stop();}
Expand Down Expand Up @@ -134,7 +134,37 @@ while (1)
arm.resume();
IntakeController.resume();
}
wait(5);

if (bL1&&bL2&&bR1&&bR2)
{
StopDrive(hold);
arm.suspend();
rampcontroller.suspend();
IntakeController.suspend();
timer2.suspend();
gyrotrack.suspend();
rampwheel.suspend();
printscreen.suspend();
intake= off;
RunRamp=off;
CubeTrack =off;
OTrack=off;
PTrack=off;
GTrack=off;
ToCube=off;
DontLiftStack=off;
DontDropStack=off;
ramp = bwrd;
wait(500);
arm.resume();
rampcontroller.resume();
IntakeController.resume();
timer2.resume();
gyrotrack.resume();
rampwheel.resume();
printscreen.resume();
}
wait(5);
}
wait(5);
}
41 changes: 24 additions & 17 deletions include/RedBlue1.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using namespace std;
using namespace vex;
using namespace G;

Color=Blue;

AutoRunning=1;

intake=off;
Expand All @@ -13,17 +13,23 @@ RampWheelL.resetRotation();
RampWheelR.resetRotation();
rightDrive(-10);
leftDrive(-10);
arm.suspend();
ArmL.setVelocity(100,vex::velocityUnits::pct);
ArmR.setVelocity(100,vex::velocityUnits::pct);
arm.suspend();

ArmR.startRotateTo(300,rotationUnits::deg);
ArmL.rotateTo(300,rotationUnits::deg);
ManualSpeed=-100;
intake=manual;
ArmR.startRotateTo(600,rotationUnits::deg);
ArmL.rotateTo(600,rotationUnits::deg);
intake=on;
RampWheelL.setVelocity(60,vex::velocityUnits::pct);
RampWheelR.setVelocity(60,vex::velocityUnits::pct);
RampWheelR.startRotateTo(-150,rotationUnits::deg);
RampWheelL.startRotateTo(-150,rotationUnits::deg);
ArmL.setVelocity(50,vex::velocityUnits::pct);
ArmR.setVelocity(50,vex::velocityUnits::pct);
//ArmL.setVelocity(50,vex::velocityUnits::pct);
//ArmR.setVelocity(50,vex::velocityUnits::pct);
ArmR.startRotateTo(0,rotationUnits::deg);
ArmL.rotateTo(0,rotationUnits::deg);
arm.suspend();
Expand Down Expand Up @@ -89,10 +95,10 @@ Move(60,-5.5,1,brake,5000);//4-5cubes(3green, maybe 1purp)
Move(45,4.2,1,coast,10000);
ManualSpeed=-50;
intake=manual;
Move(45,2.1,0,brake,10000);
Move(65,2.1,0,brake,10000);
//double tempG=-GlobalGyro/10;
//Turn(tempG,20,10000);
Move(45,-5.14104,0,brake,10000);
Move(65,-5.14104,0,brake,10000);
ArmR.startRotateTo(0,rotationUnits::deg);
ArmL.rotateTo(0,rotationUnits::deg);
intake=on;
Expand Down Expand Up @@ -129,30 +135,30 @@ T(180*Color,30,5000);
// CubeTrack=on;
// while(CubeTrack==on){wait(100);}
wait(100);
Move(40,12,1,brake,8000);
Move(60,12,1,brake,8000);
wait(100);
T(130*Color,30,5000);//135
wait(100);
Move(60,12.25,1,brake,8000);
wait(100);
Turn(-10*Color,30,5000);//-35
Turn(-20*Color,30,5000);//-35
// GTrack=off;
// PTrack=on;
// OTrack=off;
// CubeTrack=on;
// while(CubeTrack==on){wait(100);}
// wait(100);
Move(50,17,1,brake,8000);
Move(60,17,1,brake,8000);
// CubeTrack=on;
// while(CubeTrack==on){wait(100);}
// wait(100);
Move(30,10,1,brake,8000);
Move(60,11,1,brake,8000);
wait(200);
Move(60, -3,1,brake,3000);
/*Move(60, -3,1,brake,3000);
wait(100);
Turn(-45*Color,30,5000);
wait(100);
Move(60,-7,1,brake,8000);
Move(60,-8,1,brake,8000);
wait(100);
Turn(50*Color,30,5000);
// GTrack=on;
Expand All @@ -161,15 +167,16 @@ Turn(50*Color,30,5000);
// CubeTrack=on;
// while(CubeTrack==on){wait(100);}
wait(100);
Move(30, 15,1,brake,3000);
wait(100);
Move(60, -22,1,brake,3000);
Move(60, 17,1,brake,3000);
wait(100);*/
Move(60, -16,1,brake,3000);//22
wait(100);
//T(0*Color,30,5000);
//T(-88*Color,30,5000);//-92
Turn(-175,30,5000);
Turn(-187*Color,30,5000);
wait(100);
Move(25, 23,1,brake,3000);
Move(60, 19,1,brake,3000);
Move(10, 4,1,brake,1500);
AutoStack();

/*Move(60,-4.1575,1,brake,5000);
Expand Down
6 changes: 3 additions & 3 deletions include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "v5_vcs.h"

#ifndef DEBUG
#define DEBUG
//#define DEBUG
#endif

#ifndef ENUMS
Expand All @@ -35,7 +35,7 @@ ToggleMode ContinueStack=off;
ToggleMode ControlIntake=off;
typedef enum _directional {fwrd=-1,bwrd=1} directional;
directional ramp = bwrd;
typedef enum _Alliance {Red=2,Blue=1} Alliance;
typedef enum _Alliance {Red=-1,Blue=1} Alliance;
Alliance Color = Blue;

#endif
Expand Down Expand Up @@ -198,6 +198,6 @@ void Colors(ToggleMode,ToggleMode,ToggleMode);
vex::task controllerprint (PrintController);
vex::task cubes (TurnToCube);
vex::task rampwheel (RampWheels);
vex::task cubeload (CubeLoad);
vex::task cubeload;
vex::task stack;
#endif
4 changes: 2 additions & 2 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int PrintScreen() {
Brain.Screen.printAt(1, 160, "RunRamp: %1.2f", RunRamp);
Brain.Screen.printAt(1, 180, "ramp: %d", ramp);
Brain.Screen.printAt(1, 200, "RampL: %1.2f", enc(RampL));
//Brain.Screen.printAt(1, 220, "NULL: %1.2f", false);
Brain.Screen.printAt(1, 220, "Color (R -1, B 1): %d", Color);
//Brain.Screen.printAt(1, 240, "NULL: %1.2f", false);
//Brain.Screen.printAt(1, 90, "%f", Gyro.value(vex::rotationUnits::raw));
//Brain.Screen.printAt(340, 20, "ARM: %1.1f", enc(ArmR));
Expand Down Expand Up @@ -524,7 +524,7 @@ int AutoStack()
ramp=bwrd;
Move(20,-6,1,coast,3000);
RunRamp=on;
Move(40,-2.8,0,brake,3000);
Move(40,-3.5,0,brake,3000);
ArmR.startRotateTo(0,rotationUnits::deg);
ArmL.startRotateTo(0,rotationUnits::deg);
wait(1000);
Expand Down
14 changes: 7 additions & 7 deletions include/usercontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ while (1)
{
if (bUp==1)
{ StopDrive(hold);}
else if (AutoRunning == 0 && (abs(ch3) > 10 || abs(ch1) > 10)) {
else if (AutoRunning == 0 && (abs(ch3) > 10 || abs(ch4) > 10)) {
CubeTrack=off;
ToCube=off;
run(LF, (ch3 + ch1/3)); //(Axis3+Axis4)/2
run(LM, (ch3 + ch1/3));
run(LB, (ch3 + ch1/3)); //(Axis3+Axis4)/2
run(RF, (ch3 - ch1/3)); //(Axis3-Axis4)/2
run(RM, (ch3 - ch1/3));
run(RB, (ch3 - ch1/3)); //(Axis3-Axis4)/2
run(LF, (ch3 + ch4/3)); //(Axis3+Axis4)/2
run(LM, (ch3 + ch4/3));
run(LB, (ch3 + ch4/3)); //(Axis3+Axis4)/2
run(RF, (ch3 - ch4/3)); //(Axis3-Axis4)/2
run(RM, (ch3 - ch4/3));
run(RB, (ch3 - ch4/3)); //(Axis3-Axis4)/2
}
else if (AutoRunning == 0&&CubeTrack==off&&ToCube==off) {
StopDrive(brake);
Expand Down
Loading

0 comments on commit 724d3ec

Please sign in to comment.