Merge remote-tracking branch 'origin/master'

This commit is contained in:
scottbadger777
2021-08-12 19:39:49 -05:00
2 changed files with 31 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ public class CaydenFirstState extends CyberarmState {
//here, you'll find some of your variables. you can add more as you need them.
private Robot robot;
private double variable=1;
//This is the constructor. It lets other code bits run use the code you put here
public CaydenFirstState(Robot robot) {

View File

@@ -0,0 +1,30 @@
package org.timecrafters.javaClass.cayden;
import org.cyberarm.engine.V2.CyberarmState;
import org.timecrafters.UltimateGoal.Competition.Robot;
public class Cayden_Autonomous extends CyberarmState {
private Robot robot;
private double variable=.5;
public Cayden_Autonomous(Robot robot) {
this.robot = robot;
}
@Override
public void exec() {
robot.driveFrontRight.setPower(variable);
robot.driveBackRight.setPower(variable);
robot.driveFrontLeft.setPower(variable);
robot.driveBackLeft.setPower(variable);
if (robot.encoderLeft.getCurrentPosition()>=300){
variable=0;
}
}
}