Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Servo Help (http://www.chiefdelphi.com/forums/showthread.php?t=135194)

itwasntme455 25-02-2015 23:13

Servo Help
 
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

Re: Servo Help
 
Quote:

Originally Posted by itwasntme455 (Post 1449973)
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

Re: Servo Help
 
Quote:

Originally Posted by itwasntme455 (Post 1449973)
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

Re: Servo Help
 
1 Attachment(s)
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.


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

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