Skip to content

Commit

Permalink
updated test wiring
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikar22 committed Sep 14, 2024
1 parent 7d4e06d commit 22b17ff
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.firstinspires.ftc.teamcode.ftc16072.OpModes;

import com.acmerobotics.dashboard.config.Config;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Servo;

@TeleOp
@Config
public class TrainingOpMode extends OpMode {
public static double B_POWER = 1.0;
public static double X_POWER = 0;
Servo servo;
DcMotor motor;
public static double CLAW_OPEN = 0.5;
public static double CLAW_CLOSE = 0.9;

@Override
public void init() {
telemetry.addData("Programmer", "Kavya");
servo = hardwareMap.get(Servo.class, "servo");
motor = hardwareMap.get(DcMotor.class, "motor");
}

@Override
public void loop() {
double yStick = -gamepad1.left_stick_y;
double speed = yStick / 2;
telemetry.addData("Y", yStick);
telemetry.addData("speed", speed);
if (gamepad1.a) {
servo.setPosition(CLAW_OPEN);
} else {
servo.setPosition(CLAW_CLOSE);
}
if (gamepad1.b) {
motor.setPower(B_POWER);
} else if (gamepad1.x) {
motor.setPower(X_POWER);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
* Joshua Smith
* Shreyas Thota
* Rebecca Smith
* Ritika Rajagopali
* Ritika Rajagopal
* Kavya Boinepally
* Diya Mishra

0 comments on commit 22b17ff

Please sign in to comment.