Package org.firstinspires.ftc.teamcode
Enum API.Motor
- java.lang.Object
-
- java.lang.Enum<API.Motor>
-
- org.firstinspires.ftc.teamcode.API.Motor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
resetEncoder()
Resets the encodervoid
setBehaviour(API.MotorBehaviour behaviour)
Set the zero-power behaviour of the motor.void
setDirection(API.Direction direction)
Sets the direction the motor should move in, without starting the motorvoid
setDirection(API.Direction direction, boolean immediate)
void
setPower(double power)
Sets the power without starting the motorvoid
start()
Starts the motorvoid
start(double power)
Starts the motor with the specified powervoid
stop()
Stops the motor and sets the power to 0static API.Motor
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static API.Motor[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
M0
public static final API.Motor M0
-
M1
public static final API.Motor M1
-
M2
public static final API.Motor M2
-
M3
public static final API.Motor M3
-
M4
public static final API.Motor M4
-
M5
public static final API.Motor M5
-
M6
public static final API.Motor M6
-
M7
public static final API.Motor M7
-
-
Method Detail
-
values
public static API.Motor[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (API.Motor c : API.Motor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static API.Motor valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
start
public void start()
Starts the motor
-
start
public void start(double power)
Starts the motor with the specified power- Parameters:
power
- the power to use for the motor
-
stop
public void stop()
Stops the motor and sets the power to 0
-
setPower
public void setPower(double power)
Sets the power without starting the motor- Parameters:
power
- the power to use for the motor
-
setDirection
public void setDirection(API.Direction direction)
Sets the direction the motor should move in, without starting the motor- Parameters:
direction
- the direction to use for the motor
-
setDirection
public void setDirection(API.Direction direction, boolean immediate)
-
resetEncoder
public void resetEncoder()
Resets the encoder
-
setBehaviour
public void setBehaviour(API.MotorBehaviour behaviour)
Set the zero-power behaviour of the motor. BRAKE means to immediately apply brakes when power is 0, and FLOAT means to come to a rolling stop.- Parameters:
behaviour
- The behaviour to use
-
-