diff options
author | Franklin Wei <me@fwei.tk> | 2018-12-08 20:46:18 -0500 |
---|---|---|
committer | Franklin Wei <me@fwei.tk> | 2018-12-08 20:46:18 -0500 |
commit | 2378d7c5e23d97720b75c75092249d9af776d33c (patch) | |
tree | a4a335f1236a4bfc3232ec0905f6141450c930f3 | |
parent | 69b2ebd2c65c49a3ac82662a62ee80c91134d3e2 (diff) | |
download | ftc-2378d7c5e23d97720b75c75092249d9af776d33c.zip ftc-2378d7c5e23d97720b75c75092249d9af776d33c.tar.gz ftc-2378d7c5e23d97720b75c75092249d9af776d33c.tar.bz2 ftc-2378d7c5e23d97720b75c75092249d9af776d33c.tar.xz |
New stuff
-rwxr-xr-x | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/HardwarePushbot.java | 5 | ||||
-rwxr-xr-x | TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PushbotTeleopPOV_Linear.java | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/HardwarePushbot.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/HardwarePushbot.java index 73d7cd6..e5b3376 100755 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/HardwarePushbot.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/HardwarePushbot.java @@ -30,7 +30,6 @@ package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.hardware.DcMotor; -import com.qualcomm.robotcore.hardware.DcMotorSimple; import com.qualcomm.robotcore.hardware.HardwareMap; import com.qualcomm.robotcore.hardware.Servo; import com.qualcomm.robotcore.util.ElapsedTime; @@ -89,7 +88,7 @@ public class HardwarePushbot DriveLeft = hwMap.get(DcMotor.class, "DriveLeft"); DriveRight = hwMap.get(DcMotor.class, "DriveRight"); - IntakeMotor = hwMap.get(DcMotor.class, "RelicMotor"); + IntakeMotor = hwMap.get(DcMotor.class, "IntakeMotor"); DriveLeft.setDirection(DcMotor.Direction.FORWARD); // Set to REVERSE if using AndyMark motorsF DriveRight.setDirection(DcMotor.Direction.REVERSE);// .setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors @@ -105,7 +104,7 @@ public class HardwarePushbot // May want to use RUN_USING_ENCODERS if encoders are installed. DriveLeft.setMode(DcMotor.RunMode.RUN_USING_ENCODER); DriveRight.setMode(DcMotor.RunMode.RUN_USING_ENCODER); - IntakeMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); + IntakeMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); /* stop these motors actively */ diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PushbotTeleopPOV_Linear.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PushbotTeleopPOV_Linear.java index 8dd8c14..232a201 100755 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PushbotTeleopPOV_Linear.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PushbotTeleopPOV_Linear.java @@ -30,10 +30,8 @@ package org.firstinspires.ftc.teamcode; import com.qualcomm.hardware.modernrobotics.ModernRoboticsI2cGyro; -import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; -import com.qualcomm.robotcore.hardware.DcMotor; import com.qualcomm.robotcore.hardware.DeviceInterfaceModule; import com.qualcomm.robotcore.util.Range; @@ -212,17 +210,17 @@ public class PushbotTeleopPOV_Linear extends LinearOpMode { double rotate = gamepad1.right_stick_x; if(gamepad1.dpad_up) - forward += fine_speed; - if(gamepad1.dpad_down) forward -= fine_speed; + if(gamepad1.dpad_down) + forward += fine_speed; if(gamepad1.dpad_left) rotate -= fine_speed; if(gamepad1.dpad_right) rotate += fine_speed; double [] powers = new double[2]; - powers[0] = forward + rotate; - powers[1] = forward - rotate; + powers[0] = forward - rotate; + powers[1] = forward + rotate; // Normalize the values so neither exceed +/- 1.0 @@ -233,7 +231,13 @@ public class PushbotTeleopPOV_Linear extends LinearOpMode { powers[1] /= max; } + double intake = 0; + if(gamepad1.right_bumper) + intake += .5; + if(gamepad1.left_bumper) + intake -= .5; + robot.IntakeMotor.setPower(intake); robot.DriveLeft.setPower(powers[0]); robot.DriveRight.setPower(powers[1]); // Send telemetry message to signify robot running; |