Go to Post The problem with anecdotal evidence is that you never seem to get the whole anecdote. - Lea DeFoote [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread Today, 02:11
Skammerman0 Skammerman0 is offline
Registered User
FRC #5199
 
Join Date: Feb 2017
Location: Laguna Niguel, California
Posts: 1
Skammerman0 is an unknown quantity at this point
Setting Servo Values

Hello all,

Our team is using an Actuonix L16 servo and we are trying to program it to extend to set values. I am able to fully extend it and extend it half-way, but I cannot make it fully retract. Here is my code:

Code:
Joystick XBACKS = new Joystick(0);
double servoBoy = 0.0;
Servo servoDude = new Servo(0);

while (isOperatorControl() && isEnabled()) {
                        if(XBACKS.getRawButton(3)){
				
			servoBoy = 0.0;
			servoDude.set(servoBoy);

			}
			
			if(XBACKS.getRawButton(4)){
				servoBoy =  .5;
				servoDude.set(servoBoy);
			}
			
			if(XBACKS.getRawButton(5)){
				servoBoy = 1.0;
				servoDude.set(servoBoy);
			}
                 }
The code is a bit abbreviated but all the ideas are there.
If anyone could tell me what I'm doing wrong, then that would be really helpful. Thank you!
Reply With Quote
  #2   Spotlight this post!  
Unread Today, 09:48
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 40
MuskieProgramme is an unknown quantity at this point
Re: Setting Servo Values

I'm on an FTC team which regularly uses servos. Last year, when they introduced the new control system we noticed our servos would not hit their extents (full left/full right). It turns out, the default was set to drive ModernRobotics servos, not HiTechnic, and they use different pulse widths.

So I'd try changing the minimum pulse width the Servo class is sending out.
Reply With Quote
Reply


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 20:10.

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