mirror of
https://github.com/TimeCrafters/UltimateGoal.git
synced 2025-12-15 05:52:35 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.timecrafters.javaClass.aubrey;
|
||||
|
||||
import com.qualcomm.hardware.rev.RevBlinkinLedDriver;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmState;
|
||||
import org.timecrafters.javaClass.samples.SampleRobot;
|
||||
|
||||
@@ -23,10 +25,14 @@ public class dance extends CyberarmState {
|
||||
robot.driveFrontLeft.setPower(-powerWorks);
|
||||
robot.driveFrontRight.setPower(powerWorks);
|
||||
|
||||
if (1 < rotation && rotation< 15){
|
||||
if (-1 > rotation && rotation> -15){
|
||||
powerWorks = 0;
|
||||
|
||||
}
|
||||
robot. ledDriver. setPattern(RevBlinkinLedDriver.BlinkinPattern.RAINBOW_RAINBOW_PALETTE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void telemetry() {engine.telemetry.addData("rotation",robot.getIMURotation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||
import org.cyberarm.engine.V2.CyberarmEngine;
|
||||
import org.timecrafters.UltimateGoal.Competition.Robot;
|
||||
import org.timecrafters.javaClass.cayden.CaydenFirstState;
|
||||
import org.timecrafters.javaClass.cayden.Cayden_Autonomous;
|
||||
|
||||
@Autonomous (name = "Cayden: First Program", group = "caden")
|
||||
public class CaydenFirstEngine extends CyberarmEngine {
|
||||
@@ -21,6 +22,6 @@ public class CaydenFirstEngine extends CyberarmEngine {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
addState(new CaydenFirstState(robot));
|
||||
addState(new Cayden_Autonomous(robot));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user