Assign Servo to button
Page 1 of 1

Author:  Sellers3143 [ Fri Dec 05, 2008 11:37 am ]
Post subject:  Assign Servo to button

Im using an else if statement to say if the button is pressed the servo opens but I have to set it to a joystick also with the value how can I just assign it to one button with the 127 value?

Author:  l0jec [ Fri Dec 05, 2008 12:29 pm ]
Post subject:  Re: Assign Servo to button

There are a number of ways and it is really up to you how you want it to work. If you are mapping your servo control to buttons on a joystick, you could map a particular button to a constant servo value (say 220 is the position for it being open) and another press or another button sets the servo to another constant value (say 15 is the position for it being shut).
You could have open/close buttons that incrementally move the servo target as well.
servo(sellersServo) = servoValue(sellersServo) + 1);

Decide exactly how you want to control it with the joystick, read the documentation on the servos and joysticks, & then get creative.

If you have more specific questions, you'll need to post exactly what you're trying to do as well as your code.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group