Skip to content

Commit

Permalink
Updated revolution time
Browse files Browse the repository at this point in the history
Also removed the servos because the arm isn't attached right now and the
meet is in a few minutes.
  • Loading branch information
blabel3 committed Jan 22, 2017
1 parent e203425 commit 48f7571
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ public class DadDriver extends OpMode
private DcMotor spinner = null;
private DcMotor shooter = null;

// the claw objects
// uninplemented claw objects
private CRServo leftClaw = null;
private CRServo rightClaw = null;

// uninplemented claw objects
private DcMotor verticalClawMotor = null;
private DcMotor horizontalClawMotor = null;

// shooter variables
private double endTime = 0;
private final double revolutionTime = 1;
private final double revolutionTime = 0.5;


/* Code to run ONCE when the driver hits INIT */
Expand All @@ -89,10 +88,10 @@ public void init() {
shooter = hardwareMap.dcMotor.get("shooter");
spinner = hardwareMap.dcMotor.get("spinner");

/* unimplemented claw objects
leftClaw = hardwareMap.crservo.get("left claw");
rightClaw = hardwareMap.crservo.get("right claw");
/* unimplemented claw objects
verticalClawMotor = hardwareMap.dcMotor.get("vertical claw");
horizontalClawMotor = hardwareMap.dcMotor.get("horizontal claw");
*/
Expand All @@ -117,10 +116,10 @@ public void init() {
spinner.setDirection(DcMotor.Direction.FORWARD);
shooter.setDirection(DcMotor.Direction.FORWARD);

/* unimplemented claw objects
leftClaw.setDirection(CRServo.Direction.FORWARD);
rightClaw.setDirection(CRServo.Direction.REVERSE);
/* unimplemented claw objects
verticalClawMotor.setDirection(DcMotor.Direction.FORWARD);
horizontalClawMotor.setDirection(DcMotor.Direction.FORWARD);
*/
Expand Down Expand Up @@ -149,8 +148,8 @@ public void loop() {
telemetry.addData("Right Motor", rightMotor.getPower());
telemetry.addData("Left Motor", leftMotor.getPower());
telemetry.addData("Spinner", spinner.getPower());
telemetry.addData("Left Claw", leftClaw.getPower());
telemetry.addData("Right Claw", rightClaw.getPower());
//telemetry.addData("Left Claw", leftClaw.getPower());
//telemetry.addData("Right Claw", rightClaw.getPower());


// Drivetrain code (note: The joystick goes negative when pushed forwards)
Expand All @@ -176,7 +175,7 @@ public void loop() {
shooter.setPower(0);
}

// claw code (uses the second gamepad)
/* unimplemented claw objects
if (gamepad2.a){
leftClaw.setPower(0.5);
rightClaw.setPower(0.5);
Expand All @@ -201,7 +200,7 @@ public void loop() {
rightClaw.setPower(-gamepad2.left_trigger);
}
/* unimplemented claw objects
if (gamepad2.dpad_up){
verticalClawMotor.setPower(0.89);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public class Unbeacon extends LinearOpMode {

private DcMotor leftMotor = null;
private DcMotor rightMotor = null;

private DcMotor spinner = null;
private DcMotor shooter = null;

/*Declaring constant values */
final int MOTOR_PULSE_PER_REVOLUTION = 7;
Expand All @@ -71,16 +73,21 @@ public class Unbeacon extends LinearOpMode {

@Override
public void runOpMode() throws InterruptedException {

/* Initialize the hardware variables. The strings must
correspond to the names in the configuration file. */
leftMotor = hardwareMap.dcMotor.get("left motor");
rightMotor = hardwareMap.dcMotor.get("right motor");

shooter = hardwareMap.dcMotor.get("shooter");
spinner = hardwareMap.dcMotor.get("spinner");

// Set the drive motor directions
leftMotor.setDirection(DcMotor.Direction.REVERSE);
rightMotor.setDirection(DcMotor.Direction.FORWARD);

spinner.setDirection(DcMotor.Direction.FORWARD);
shooter.setDirection(DcMotor.Direction.FORWARD);

/* Prepare the encoders to be used */
//Reset their values
Expand All @@ -90,7 +97,9 @@ public void runOpMode() throws InterruptedException {
//Set their modes.
leftMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
rightMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);

spinner.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
shooter.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);

telemetry.addData("Status", "Initialized!");
telemetry.update();
Expand Down

0 comments on commit 48f7571

Please sign in to comment.