ServoAttachment

open class ServoAttachment(name: String, servo: Servo, val direction: Servo.Direction = Servo.Direction.FORWARD) : Attachment

ServoAttachment is an Attachment that controls a servo.

Parameters

name

the name of the servo

servo

the servo to control

direction

the direction of the servo

Constructors

Link copied to clipboard
constructor(name: String, servo: Servo, direction: Servo.Direction = Servo.Direction.FORWARD)

Properties

Link copied to clipboard
val direction: Servo.Direction
Link copied to clipboard
Link copied to clipboard

the position of the servo

Link copied to clipboard
val state: StateFlow<AttachmentState>

Functions

Link copied to clipboard
fun goTo(target: ServoPosition): Action

Go to a specified target position.

fun goTo(target: Double): Action
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

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

Link copied to clipboard
open 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.