FreeOfCharge2022-23/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MyFIRSTJavaOpMode.java
Nathan Wang cfafe34339 initial commit
\
2021-10-19 17:53:06 -05:00

56 lines
1.8 KiB
Java

package org.firstinspires.ftc.teamcode;
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.DigitalChannel;
import com.qualcomm.robotcore.hardware.DistanceSensor;
import com.qualcomm.robotcore.hardware.Gyroscope;
import com.qualcomm.robotcore.hardware.Servo;
@TeleOp
public class MyFIRSTJavaOpMode extends LinearOpMode {
private Gyroscope imu;
private DcMotor frontRight;
private DcMotor frontLeft;
private DcMotor rearRight;
private DcMotor rearLeft;
private DigitalChannel digitalTouch;
private DistanceSensor sensorColorRange;
private Servo servoTest;
@Override
public void runOpMode() {
//imu = hardwareMap.get(Gyroscope.class, "imu");
frontRight = hardwareMap.get(DcMotor.class, "frontRight");
frontLeft = hardwareMap.get(DcMotor.class, "frontLeft");
rearRight = hardwareMap.get(DcMotor.class, "rearRight");
rearLeft = hardwareMap.get(DcMotor.class, "rearLeft");
//digitalTouch = hardwareMap.get(DigitalChannel.class, "digitalTouch");
//sensorColorRange = hardwareMap.get(DistanceSensor.class, "sensorColorRange");
//servoTest = hardwareMap.get(Servo.class, "servoTest");
frontRight.setPower(0.5);
frontLeft.setPower(0.5);
rearLeft.setPower(0.5);
rearRight.setPower(0.5);
telemetry.addData("Status", "Initialized");
telemetry.update();
// Wait for the game to start (driver presses PLAY)
waitForStart();
// run until the end of the match (driver presses STOP)
while (opModeIsActive()) {
telemetry.addData("Status", "Running");
telemetry.update();
}
}
}