Log in

View Full Version : Servo Help


itwasntme455
25-02-2015, 23:13
We need a servo to move in one direction when button "A" or "B" is pressed and held but only move a certain distance. Then when you release button "A" or "B" the servo will move back the same distance and stop. How do we do this?

itwasntme455
25-02-2015, 23:29
We need a servo to move in one direction when button "A" or "B" is pressed and held but only move a certain distance. Then when you release button "A" or "B" the servo will move back the same distance and stop. How do we do this?

Would this work?

https://scontent-ord.xx.fbcdn.net/hphotos-xpf1/v/t1.0-9/11026250_10200285123408733_1602389002403779689_n.j pg?oh=5e3563c457b205e5364e54ce19b28a98&oe=5548BC9A

NHoffmann
12-03-2015, 09:34
We need a servo to move in one direction when button "A" or "B" is pressed and held but only move a certain distance. Then when you release button "A" or "B" the servo will move back the same distance and stop. How do we do this?

You might be able to do this with a sequence structure. While button A is pressed, first move servo for X seconds, create a while loop in a new frame, re-acquire the button value, set the servo to 0, then set the loop to continue while the button is pressed.

nwall
12-03-2015, 23:03
I think this code does what you want it to. I think "itwasntme455" code might work, but I'm not sure because I can't see inside of the other cases.

servoThreePos.vi:
will simply check which position you're trying to go to, and then set position based on that. If you want, you can just replace "SetPosition" with "SetRotation" and replace the values for the positions.