mirror of
https://github.com/TimeCrafters/UltimateGoal.git
synced 2025-12-15 22:02:33 +00:00
a thing
This commit is contained in:
@@ -11,10 +11,14 @@ public class Cayden_Dimitri {
|
||||
}
|
||||
|
||||
public DcMotor driveLeft;
|
||||
public DcMotor arm;
|
||||
public DcMotor driveRight;
|
||||
|
||||
public void hardware_init(){
|
||||
|
||||
arm = hardwareMap.dcMotor.get("arm motor");
|
||||
driveLeft = hardwareMap.dcMotor.get("frontLeft");
|
||||
driveRight = hardwareMap.dcMotor.get("frontRight");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,5 +13,11 @@ public class Cayden_Dimitri_Move extends CyberarmState {
|
||||
public void exec() {
|
||||
robot.driveRight.setPower(.75);
|
||||
robot.driveLeft.setPower(.75);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void telemetry() {
|
||||
engine.telemetry.addData("arm position",robot.arm.getCurrentPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package org.timecrafters.javaClass.cayden;
|
||||
|
||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmEngine;
|
||||
|
||||
@Autonomous(name="Cayden_Dimitri_Move")
|
||||
|
||||
public class Cayden_Dimitri_engine extends CyberarmEngine {
|
||||
|
||||
private Cayden_Dimitri cayden_dimitri;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.timecrafters.javaClass.cayden;
|
||||
|
||||
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
|
||||
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||
import com.qualcomm.robotcore.hardware.HardwareMap;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmEngine;
|
||||
|
||||
@TeleOp(name = "Cayden: First Program", group = "caden")
|
||||
|
||||
public class miniboi extends CyberarmEngine {
|
||||
private HardwareMap hardwareMap;
|
||||
public miniboi(HardwareMap hardWareMap) {
|
||||
hardwareMap = hardWareMap;
|
||||
}
|
||||
|
||||
public DcMotor driveleft;
|
||||
public DcMotor driveright;
|
||||
|
||||
public void hardwareInt() {
|
||||
driveleft = hardwareMap.dcMotor.get("frontLeft");
|
||||
driveright = hardwareMap.dcMotor.get("frontRight");
|
||||
addState(new Minibot_State(robot,1,12));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.timecrafters.javaClass.cayden;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmState;
|
||||
|
||||
public class Minibot_State extends CyberarmState {
|
||||
|
||||
private Minibot_State robot;
|
||||
|
||||
public Minibot_State(Minibot_State robot) {
|
||||
this.robot = robot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec() {
|
||||
if (engine.gamepad1.right_trigger > -0.5) {
|
||||
robot.driveleft.setPower(1);
|
||||
} else robot.driveleft.setPower(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user