diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index f1d5e0f..2af15c8 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -89,8 +89,8 @@
-
-
+
+
diff --git a/src/main/java/org/sert2521/powerup/RobotName.kt b/src/main/java/org/sert2521/powerup/RobotName.kt
index e40520b..7446933 100644
--- a/src/main/java/org/sert2521/powerup/RobotName.kt
+++ b/src/main/java/org/sert2521/powerup/RobotName.kt
@@ -1,6 +1,7 @@
package org.sert2521.powerup
import org.sert2521.powerup.drivetrain.Drivetrain
+import org.sert2521.powerup.elevator.Elevator
import org.sert2521.powerup.intake.Intake
import org.sertain.Robot
@@ -8,5 +9,6 @@ class RobotName : Robot() {
override fun onCreate() {
Drivetrain
Intake
+ Elevator
}
}
diff --git a/src/main/java/org/sert2521/powerup/elevator/Elevator.kt b/src/main/java/org/sert2521/powerup/elevator/Elevator.kt
new file mode 100644
index 0000000..177e2b4
--- /dev/null
+++ b/src/main/java/org/sert2521/powerup/elevator/Elevator.kt
@@ -0,0 +1,20 @@
+package org.sert2521.powerup.elevator
+
+import org.sert2521.powerup.elevator.commands.TeleopElevator
+import org.sert2521.powerup.util.LEFT_ELEVATOR_MOTOR
+import org.sert2521.powerup.util.RIGHT_ELEVATOR_MOTOR
+import org.sertain.command.Subsystem
+import org.sertain.hardware.Talon
+import org.sertain.hardware.autoBreak
+import org.sertain.hardware.plus
+
+object Elevator : Subsystem() {
+ private val elevator =
+ Talon(LEFT_ELEVATOR_MOTOR).autoBreak() + Talon(RIGHT_ELEVATOR_MOTOR).autoBreak()
+
+ override val defaultCommand = TeleopElevator()
+
+ fun set(speed: Double) = elevator.set(speed)
+
+ fun stop() = elevator.stopMotor()
+}
diff --git a/src/main/java/org/sert2521/powerup/elevator/commands/TeleopElevator.kt b/src/main/java/org/sert2521/powerup/elevator/commands/TeleopElevator.kt
new file mode 100644
index 0000000..38f1834
--- /dev/null
+++ b/src/main/java/org/sert2521/powerup/elevator/commands/TeleopElevator.kt
@@ -0,0 +1,20 @@
+package org.sert2521.powerup.elevator.commands
+
+import org.sert2521.powerup.elevator.Elevator
+import org.sert2521.powerup.util.secondaryJoystick
+import org.sertain.command.Command
+
+class TeleopElevator : Command() {
+ init {
+ requires(Elevator)
+ }
+
+ override fun execute(): Boolean {
+ if (secondaryJoystick.trigger) Elevator.set(secondaryJoystick.y)
+ return false
+ }
+
+ override fun onDestroy() {
+ Elevator.stop()
+ }
+}
diff --git a/src/main/java/org/sert2521/powerup/util/Constants.kt b/src/main/java/org/sert2521/powerup/util/Constants.kt
index 29aaeba..91121b0 100644
--- a/src/main/java/org/sert2521/powerup/util/Constants.kt
+++ b/src/main/java/org/sert2521/powerup/util/Constants.kt
@@ -9,10 +9,13 @@ const val SECONDARY_STICK_PORT = 2
const val CONTROLLER_PORT = 3
// Talon IDs
-const val RIGHT_FRONT_MOTOR = 10
-const val RIGHT_REAR_MOTOR = 14
const val LEFT_FRONT_MOTOR = 19
const val LEFT_REAR_MOTOR = 17
+const val RIGHT_FRONT_MOTOR = 10
+const val RIGHT_REAR_MOTOR = 14
-const val RIGHT_INTAKE_MOTOR = 13
const val LEFT_INTAKE_MOTOR = 12
+const val RIGHT_INTAKE_MOTOR = 13
+
+const val LEFT_ELEVATOR_MOTOR = -1
+const val RIGHT_ELEVATOR_MOTOR = -1