Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Setting Servo Values (http://www.chiefdelphi.com/forums/showthread.php?t=155087)

Skammerman0 11-02-2017 02:11

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!

MuskieProgramme 11-02-2017 09:48

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.


All times are GMT -5. The time now is 20:10.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi