Hey Chief Delphi,
We seem to have some trouble getting the continuous rotation servo to stop moving. The servo should move when button A on Gamepad 1 is pressed and should stop when released. Here is the code snippet we have:
Code:
if (gamepad1.a ) {
// if the A button is pushed on gamepad1, increment the position of the servo.
linearPosition = linearSliderLeft.getPosition()+ linearDelta;
linearPosition = Range.clip(linearPosition, 0.2, 0.8);
linearSliderLeft.setPosition(linearPosition);
}
Should we have an else block in which we stop the servo with a setPosition call? We have tried setting it to 0.45, 0.5 and 0.55 but the servo still keeps moving.
Thanks,
The Charging Champions