pub enum Command {
ExitSafeStart,
MotorFwd {
speed: u16,
},
MotorRev {
speed: u16,
},
MotorFwd7bit {
speed: u8,
},
MotorRev7bit {
speed: u8,
},
MotorBrake {
brake_amount: u8,
},
SetCurrentLimit {
value: u16,
},
StopMotor,
}
Expand description
Representations of the commands that can be sent to the controller.
These only contain the commands which do not provide any response, which can thus be used in [SimpleMotorController::send_command
]. There are some additional commands available that do provide a response. These are handled
separately by the methods [SimpleMotorController::set_motor_limit
] and [SimpleMotorController::get_firmware_version
].
Variants§
ExitSafeStart
If safe-start protection is enabled, this command is required before the motor can run.
MotorFwd
Sets the full-resolution motor target speed in the forward direction.
MotorRev
Sets the full-resolution motor target speed in the reverse direction.
MotorFwd7bit
Sets the low-resolution motor target speed in the forward direction.
MotorRev7bit
Sets the low-resolution motor target speed in the reverse direction.
MotorBrake
Causes the motor to immediately brake or coast (configured deceleration limits are ignored).
SetCurrentLimit
This command lets you change the hardware current limit temporarily until the next reset.
Fields
StopMotor
Sets the motor target speed to zero, stopping the motor respecting the configured deceleration limits. This also makes the controller susceptible to a safe-start violation error is safe-start is enabled.