CRServoAttachment

open class CRServoAttachment(name: String, crServo: CRServo, direction: DcMotorSimple.Direction = DcMotorSimple.Direction.FORWARD) : Attachment

CRServoAttachment is an Attachment that controls a crServo.

Parameters

name

the name of the attachment

crServo

the cr servo to control

direction

the direction of the cr servo

Inheritors

Constructors

Link copied to clipboard
constructor(name: String, crServo: CRServo, direction: DcMotorSimple.Direction = DcMotorSimple.Direction.FORWARD)

Properties

Link copied to clipboard
Link copied to clipboard
val state: StateFlow<AttachmentState>

Functions

Link copied to clipboard

Checks if the attachment is currently busy (Running).

Link copied to clipboard

Checks if the attachment is currently in a faulted state.

Link copied to clipboard
fun moveFor(power: Power, seconds: Seconds): Action

Move for a specified amount of seconds and a specified power.

fun moveFor(power: Double, seconds: Double): Action
Link copied to clipboard

Ensures the attachment is in the Idle state, throwing an exception if not.

Link copied to clipboard
fun start(power: Power): Action

Start moving the cr servo at a specified power.

fun start(power: Double): Action
Link copied to clipboard
open override fun stop()

Stops the attachment and resets its state to Idle.

Link copied to clipboard
context(telemetry: Telemetry)
open override fun update()

Updates the telemetry with the current state of the attachment.