View Single Post
  #2   Spotlight this post!  
Unread 04-02-2009, 21:02
pheadxdll pheadxdll is offline
Registered User
AKA: Alex
FRC #1225 (Amperage Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: North Carolina
Posts: 168
pheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud of
Re: How to Program a Servo

I think your major problem is that you haven't read any of the documentation on C++ coding: http://first.wpi.edu/Images/CMS/First/FRC1718Docs.zip There's a nice packet of information there. Here's how to fix your program:

Code:
void OperationControl(void)
{
   GetWatchdog().SetEnabled(true);
   while(IsOperatorControl())
   {
      servo.Set(1.0);
      GetWatchdog().Feed();
   }
}
The Set method takes a value from 0.0 to 1.0 (full left to full right)

Also, make sure you have a jumper set on the sidecar next to the pwm output for the servo.
__________________
Amperage Robotics Team 1225
Site under-going revamp. :/

Last edited by pheadxdll : 04-02-2009 at 21:05.
Reply With Quote