SimpleRotator

open class SimpleRotator : DcMotorSimple

Drop-in replacement for DcMotorSimple (and by extension, DcMotor and CRServo) to support write caching, refresh rates, and internal power clamps/scales.

This class is internally implemented by Motor. This class is exposed for CRServo uses and other motor implementations that do not need the full suite of Motor utilities.

Author

Lucas Bubner, 2024

Since

6.0.0

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull dms: DcMotorSimple)
Wrap a DcMotorSimple to use in the SimpleCachedRotator class.

Functions

Link copied to clipboard
open fun close()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getDirection(): DcMotorSimple.Direction
Link copied to clipboard
open fun getManufacturer(): HardwareDevice.Manufacturer
Link copied to clipboard
open fun getPower(): Double
Link copied to clipboard
open fun getVersion(): Int
Link copied to clipboard
open fun setDirection(@NonNull direction: DcMotorSimple.Direction)
Link copied to clipboard
open fun setMaxPower(magnitude: Double)
Sets the maximum power magnitude (applies for both negative and positive powers) this motor can run at.
Link copied to clipboard
open fun setPower(power: Double)
Link copied to clipboard
open fun setPowerDeltaThreshold(magnitude: Double)
Set the delta in power required to propagate a hardware write.
Link copied to clipboard
open fun setPowerRefreshRate(@NonNull refreshRate: Measure<Time>)
Set the refresh rate of the motor that will be a minimum time between hardware writes.