SetCRServoPowerAction

Overview

SetCRServoPowerAction is a simple RR Action that instantly sets a continuous rotation servo to a specified power and completes immediately.


Usage

SetCRServoPowerAction(CRServo, double)

CRServo intake = hardwareMap.crservo.get("intake");

runBlocking(
    new SequentialAction(
        new SetCRServoPowerAction(intake, 1.0), // Spin intake
        new SleepAction(0.5),                   // Wait 0.5 seconds
        new SetCRServoPowerAction(intake, 0.0)  // Stop spinning intake
    )
);

The servo power 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