RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
RobotMode.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5package org.wpilib.hardware.hal;
6
8public enum RobotMode {
17
18 private final int value;
19
20 RobotMode(int value) {
21 this.value = value;
22 }
23
29 public int getValue() {
30 return value;
31 }
32
34 public static RobotMode fromInt(int value) {
35 return switch (value) {
36 case 1 -> AUTONOMOUS;
37 case 2 -> TELEOPERATED;
38 case 3 -> UTILITY;
39 default -> UNKNOWN;
40 };
41 }
42}
static RobotMode fromInt(int value)