diff --git a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt index 6ff176c..c76b849 100644 --- a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt +++ b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt @@ -1,34 +1,11 @@ package org.firstinspires.ftc.teamcode.opModes.teleOp import com.arcrobotics.ftclib.command.CommandOpMode -import com.arcrobotics.ftclib.gamepad.GamepadEx import com.qualcomm.robotcore.eventloop.opmode.TeleOp -import org.firstinspires.ftc.teamcode.commands.drive.DriveCommand -import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem @TeleOp -class MainTeleOp : CommandOpMode() { - private lateinit var driveSubsystem: DriveSubsystem - - private lateinit var driveCommand: DriveCommand - - private lateinit var driver: GamepadEx +class MainTeleOp: CommandOpMode() { override fun initialize() { - - driveSubsystem = DriveSubsystem(hardwareMap) - - driver = GamepadEx(gamepad1) - - driveCommand = DriveCommand( - driveSubsystem, - leftX = driver::getLeftX, - leftY = driver::getLeftY, - rightX = driver::getRightX, - zoneVal = 0.15 - ) - - register(driveSubsystem) - - driveSubsystem.defaultCommand = driveCommand + TODO("Not yet implemented") } } \ No newline at end of file diff --git a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSlideSubsystem.kt b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSlideSubsystem.kt deleted file mode 100644 index fa2af43..0000000 --- a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSlideSubsystem.kt +++ /dev/null @@ -1,7 +0,0 @@ -package org.firstinspires.ftc.teamcode.subsystems.arm - -import com.arcrobotics.ftclib.command.SubsystemBase - -class ArmSlideSubsystem : SubsystemBase() { - -} \ No newline at end of file diff --git a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSubsystem.kt b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSubsystem.kt new file mode 100644 index 0000000..2d10ee0 --- /dev/null +++ b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSubsystem.kt @@ -0,0 +1,33 @@ +package org.firstinspires.ftc.teamcode.subsystems.arm + +import com.arcrobotics.ftclib.command.SubsystemBase +import com.arcrobotics.ftclib.hardware.motors.Motor +import com.arcrobotics.ftclib.hardware.motors.MotorGroup + +class ArmSubsystem( +// Here I am just declaring the motors and what they are called on our driver hub. + private val leftSlideAxel : Motor, + private val rightSlideAxel : Motor, + +) : SubsystemBase() { + +//Here I am making a motor group, as the arm motors are going to work together to to turn the slides. + + private val turnMotors = MotorGroup(leftSlideAxel, rightSlideAxel) + + +// Here are functions that work the motor, and the double is the speed of the motor, 1 being 100%. + fun clockwise() { + turnMotors.set(1.0) + } + + fun anticlockwise() { + turnMotors.set(-1.0) + } + + fun stop() { + turnMotors.set(0.0) + } + + +} \ No newline at end of file diff --git a/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/slides/SlidesSubsystem.kt b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/slides/SlidesSubsystem.kt new file mode 100644 index 0000000..f1b7aa4 --- /dev/null +++ b/TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/slides/SlidesSubsystem.kt @@ -0,0 +1,33 @@ +package org.firstinspires.ftc.teamcode.subsystems.slides + +import com.arcrobotics.ftclib.command.SubsystemBase +import com.arcrobotics.ftclib.hardware.motors.Motor +import com.arcrobotics.ftclib.hardware.motors.MotorGroup + +class SlidesSubsystem( + + //sets them as a private variable thats a motor (same name as in driver hub) + private val leftSlideString : Motor, + private val rightSlideString : Motor, + +) : SubsystemBase() { + //makes a motor group bc you have to move them at the same time + private val elevatorMotors = MotorGroup(leftSlideString, rightSlideString) + + + // Functions for moving slides up and down, number being speed, 1 being 100% + fun up() { + + elevatorMotors.set(1.0) + } + + fun down() { + elevatorMotors.set(-1.0) + } + + fun stop() { + elevatorMotors.set(0.0) + } + + +} \ No newline at end of file