Skip to content

Commit

Permalink
Working REV Smart CR Servo Passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
tjismith13 committed Nov 24, 2020
1 parent eccfb1e commit 550a11e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
Expand Up @@ -15,13 +15,13 @@ public Passthrough(HardwareMap hardwareMap, Telemetry telemetry) {

public void update(boolean in, boolean out) {
if(in && !out) {
intakeMotor.setPower(1);
passthroughMotor.setPower(1);
}
else if(out && !in) {
intakeMotor.setPower(-1);
passthroughMotor.setPower(-1);
}
else {
intakeMotor.setPower(0);
passthroughMotor.setPower(0);
}
}

Expand Down
Expand Up @@ -11,17 +11,21 @@ public class Robot {
public WobbleGoalClamp clamp;
public Intake intake;
public Shooter shooter;
public Passthrough passthrough;

public Robot(HardwareMap hardwareMap, Telemetry telemetry) {
drivetrain = new Drivetrain(hardwareMap, telemetry);
detector = new StarterStackDetector(hardwareMap, telemetry);
clamp = new WobbleGoalClamp(hardwareMap, telemetry);
intake = new Intake(hardwareMap, telemetry);
shooter = new Shooter(hardwareMap, telemetry);
passthrough = new Passthrough(hardwareMap, telemetry);
}
public void disableMotors() {
drivetrain.update(0, 0, 0);
shooter.update(0);
passthrough.update(false, false);
intake.update(false, false);
}
public void deactivate() {
drivetrain.disable();
Expand Down
Expand Up @@ -44,6 +44,9 @@ public RobotHardware(HardwareMap hardwareMap) {
//Intake
intakeMotor = hardwareMap.get(DcMotor.class, "intakeMotor");

//Passthrough
passthroughMotor = hardwareMap.get(CRServo.class, "passthroughMotor");

//WobbleGoalClamp
//master = hardwareMap.get(CRServo.class, "master");
//slave = hardwareMap.get(CRServo.class, "slave");
Expand Down
@@ -0,0 +1,22 @@
package org.firstinspires.ftc.teamcode.testOpModes;

import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;

import org.firstinspires.ftc.teamcode.subsystems.Robot;

@TeleOp
public class PassthroughMotorTest extends OpMode {

Robot robot;

@Override
public void init() {
robot = new Robot(hardwareMap, telemetry);
}

@Override
public void loop() {
robot.passthrough.update(gamepad1.right_bumper, gamepad1.left_bumper);
}
}

0 comments on commit 550a11e

Please sign in to comment.