View Single Post
  #1   Spotlight this post!  
Unread 24-11-2015, 01:25
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
[FTC]: Continuous Servo Keeps Rotating

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
__________________
The Charging Champions
FTC Team #8660
Facebook Page: https://www.facebook.com/chargingchampions
Follow us on Twitter: @FtcTeamCC
Google Plus: https://plus.google.com/112552147224383900922/posts
Youtube channel: https://www.youtube.com/channel/UCop...G3zsvQKCXF4ESQ
Blog: http://chargingchampionsblog.blogspot.com/
Reply With Quote