Go to Post There's a stark difference between bragging and taking pride in your work. While "Ha ha! We're better than you! We won seventeen regionals and you didn't!" would clearly fall in the former, listing your achievements would definitely fall in the latter. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 04-02-2009, 20:49
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
How to Program a Servo

Okay I am not sure how to program the servo, I have a servo plugged into the digital sidecar on PWM #3, and I am not sure how to program it moving so this is the code that we have, so could you tell us our problem?

Code:
#include "WPILib.h"
#include "xmath.h"

class RobotDemo : public SimpleRobot
{
   RobotDrive myRobot;
   Joystick leftstick;
   Joystick rightstick;
   Servo servo;
public:
   RobotDemo(void):
      myRobot(1, 2, 3),
      leftstick(1),
      rightstick(2),
      servo(3)
   {
       GetWatchdog().SetExpiration(100);
   }
   void Autonomous(void)
   {
       GetWatchdog().SetEnabled(false);
       //CODE
    }
void OperationControl(void)
{
   Servo(3);
   GetWatchdog().SetEnabled(true);
   while(IsOperatorControl())
   {
      servo.Set(170.0);
      GetWatchdog().Feed();
   }
}
};
So any suggestions?
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program a Servo? programmr Programming 5 10-02-2008 13:12
How to conect solenoids to the circuit board. and how to program it...??? arpitshah Pneumatics 6 13-01-2008 15:06
Servo Values to Degrees... How? mogunus Programming 16 11-04-2007 02:03
How much do the servo cost? Ken Leung Motors 2 14-09-2001 15:42


All times are GMT -5. The time now is 18:25.

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