View Single Post
  #5   Spotlight this post!  
Unread 06-02-2009, 16:45
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: How to Program a Servo

Quote:
Originally Posted by 3DWolf View Post
You're getting your functions confused.
servo.Set() accepts a range from -1 to 1 for min to max values of the servo - this is here so you can just directly accept another float value from something else (like a joystick) and just set it directly.
servo.SetAngle() accepts an angle that you wish to set your servo at. Try using this with your 170 angle and see if that works.
it is 0 to 1 not -1 to 1
Quote:
Originally Posted by WPILib
/**
* Set the servo position.
*
* Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.
*
* @param value Position from 0.0 to 1.0.
*/
void Servo::Set(float value)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote