ServoToPositionAction

Overview

ServoToPositionAction is a simple RR Action that instantly sets a servo to a specified position and completes immediately.


Usage

ServoToPositionAction(Servo, double)

Servo claw = hardwareMap.servo.get("claw");

runBlocking(
    new SequentialAction(
        new ServoToPositionAction(claw, 1.0), // Open claw
        new SleepAction(0.5),                 // Wait 0.5 seconds
        new ServoToPositionAction(claw, 0.0)  // Close claw
    )
);

The servo position is set instantly and the action ends right after. If you need the robot to wait for the servo to finish moving, you can follow this with a SleepAction.

Last updated