Go to Post When you open of CD and you see your very own quote up top, and can't decide if it's a really awesome or "Well...this is awkward..." moment - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-02-2015, 23:13
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 25-02-2015, 23:29
itwasntme455 itwasntme455 is offline
Registered User
AKA: Brandon
FRC #4791 (Pandroids)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: South Bend, Indiana
Posts: 26
itwasntme455 is an unknown quantity at this point
Re: Servo Help

Quote:
Originally Posted by itwasntme455 View Post
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
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2015, 09:34
NHoffmann's Avatar
NHoffmann NHoffmann is offline
Registered User
FRC #0573 (Mech Warriors)
Team Role: Programmer
 
Join Date: Sep 2014
Rookie Year: 2014
Location: Bloomfield Hills
Posts: 36
NHoffmann is an unknown quantity at this point
Re: Servo Help

Quote:
Originally Posted by itwasntme455 View Post
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.
__________________
WHO ARE WE?

573!
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2015, 23:03
nwall nwall is offline
It's a hardware problem
AKA: Nicholas
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Sep 2012
Rookie Year: 2012
Location: Austin, TX
Posts: 13
nwall is an unknown quantity at this point
Re: Servo Help

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.
Attached Files
File Type: vi servoThreePos.vi (13.6 KB, 8 views)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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