View unanswered posts | View active topics It is currently Tue May 21, 2019 1:21 am

Reply to topic  [ 2 posts ] 
Assign Servo to button 
Author Message

Joined: Tue Dec 02, 2008 12:40 pm
Posts: 9
Post 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?

Fri Dec 05, 2008 11:37 am

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 139
Post 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.

Fri Dec 05, 2008 12:29 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.