Skip to content

Commit 19663ac

Browse files
let controller1 change vision mode on D-Pad
1 parent 810a927 commit 19663ac

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/kotlin/frc/robot/RobotContainer.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,18 @@ class RobotContainer {
276276
lights.defaultCommand = setAlliance
277277

278278
/* toggle vision mode with D-Pad (pov) and toggle
279-
auto intake with start and back on controller0 */
279+
auto intake with start and back on controller0.
280+
controller1 can also change vision mode */
280281
visionToggle.defaultCommand = VisionModeChange(visionToggle) {
281282
val visionMode = {
282-
when (controller0.pov) {
283+
when (controller1.pov) {
283284
90 -> VisionModes.HIGHGOAL // right
284285
270 -> VisionModes.BALL // left
285-
else -> visionToggle.visionMode
286+
else -> when (controller0.pov) {
287+
90 -> VisionModes.HIGHGOAL // right
288+
270 -> VisionModes.BALL // left
289+
else -> visionToggle.visionMode
290+
}
286291
}
287292
}
288293

0 commit comments

Comments
 (0)