Go to Post Seeing a bunch of teams from Indiana and probably Michagin competing at the same time.... If I wanted to see that, I'd just go to the Championship in Atlanta. :yikes: - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Motors
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 30-01-2012, 14:29
smigs smigs is offline
Registered User
FRC #3373
 
Join Date: Jan 2012
Location: Warrenton, VA
Posts: 3
smigs is an unknown quantity at this point
Problems running servos

Hi everyone,

I am a coach on Team 3373 out of Warrenton, VA. Recently, our programming team was writing some code for a generic servo (I didn't think it was necessary to label the part number) in order to make sure we know how to write the code.

Displaying only the relevant portions, we defined a joystick (in Module 1) and a servo instance. Then we initialized the servo instance. We physically connected it to Module 2, Port/Channel 9. Afterwards, we noted because the joystick GetRawAxis function assumes values from [-1,1] and the Servo Set function assumes values from [0,1] we did a little algebra on the Servo Set argument.

Lastly, I printed to the driver station the value of the Servo Set argument and I saw it change as I moved the Xbox joystick. HOWEVER, the servo itself does not move.

We do have other code written (not displayed) which moves a motor and gets camera feed etc. which all work fine. But for whatever reason we cannot get the Servo to work. There are a limited number of functions for the Servo class so between trying different things and looking on Google, we just need a fresh pair of eyes. Can anyone make any suggestions? The code compiles when we run it. We obtained the skeleton of it from the Simple Robot Template in Windriver.

Many thanks,
Brian

#####BEGIN CODE #####

#include “WPILib.h”
class RobotDemo : public SimpleRobot {

Joystick Xbox;
Servo Elevation;

public: RobotDemo()
Xbox(1),
Elevation(2,9)

{
/* GetWatchdog().SetEnabled(false); */
}

void Autonomous() {
/* commented out code */
}


void OperatorControl() {
while (IsOperatorControl())
{
Elevation.Set((Xbox.GetRawAxis(5)+1)/2);
}
}

};

START_ROBOT_CLASS(RobotDemo);

#####END CODE #####
 


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 05:27.

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