Go to Post Enlighten a man who sometimes has difficulty understanding why others stray outside the box, when the box appears to be an optimized and elegant solution. - JVN [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi