Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RYANdop committed May 15, 2024
1 parent 1da45a3 commit cb97af5
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Goldfish.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package org.firstinspires.ftc.teamcode;

import static org.firstinspires.ftc.robotcore.external.BlocksOpModeCompanion.opMode;

import com.qualcomm.hardware.rev.RevBlinkinLedDriver;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.CRServo;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.IMU;
import com.qualcomm.robotcore.hardware.Servo;

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

import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName;

public class Goldfish {

public HardwareMap hwMap;

LinearOpMode auton;

public enum Drivetrain {
MECHANUM
}

public enum Team {
RED,
BLUE
}

public Drivetrain drive;

public Telemetry telem;

//defining global variables
public DcMotor armMotor, suspensionMotor, motorFL, motorFR, motorBL, motorBR;

public Servo clawServoLeft, clawServoRight;

public WebcamName webcamName;

//constants here

static final double TICKS_PER_INCH = 40;

//Encoder ticks for ticks per inch
//welovebilly

public Goldfish( OpMode opMode, Drivetrain drivetrain); {

this.hwMap = opMode.hardwareMap;

this.drive = Drivetrain;

this.telem = opMode.telemetry;

setupHardware();
}

public Goldfish( LinearOpMode opmode, Drivetrain type) {

this.auton = opmode;

hwMap = opmode.hardwareMap;

telem = opmode.telemetry;

drive = type;

setupHardware();
}

RevBlinkinLedDriver lights;

public Goldfish( HardwareMap hardwareMap, Drivetrain drivetrain) {

this.hwMap = hardwareMap;

this.drive = drivetrain;

setupHardware();

}


public void setupHardware() {

switch (drive) {

case MECHANUM:

motorFL = hwMap.dcMotor.get("motorFL");
motorFR = hwMap.dcMotor.get("motorFR");
motorBL = hwMap.dcMotor.get("motorBL");
motorBR = hwMap.dcMotor.get("motorBR");

motorFL.setDirection(DcMotorSimple.Direction.REVERSE);

}

}


}

0 comments on commit cb97af5

Please sign in to comment.