Go to Post Reading the directions is as important as reading the manual. - the man [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 16-02-2011, 13:26
M-Ross M-Ross is offline
Registered User
FRC #2909
 
Join Date: Feb 2010
Location: Rochester, IN
Posts: 7
M-Ross is an unknown quantity at this point
Action on button press and release

We would like to have a motor run one direction on a button press and the opposite direction on release. How does one program this? Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2011, 13:43
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Action on button press and release

So you want it to run one way the whole time when the button is being held and the other way the whole time the button is not held?

If that's what you want try the "Select" node. It's in the Comparisons palette I believe, and it will select the top input and pass it through if the middle input is true and the bottom input if the middle input is false. You would put the button as the middle input and your desired motor speeds as the top and bottom.

If you want to run the motor in a certain direction for a certain period of time on button press and release that becomes a little bit trickier.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2011, 14:59
M-Ross M-Ross is offline
Registered User
FRC #2909
 
Join Date: Feb 2010
Location: Rochester, IN
Posts: 7
M-Ross is an unknown quantity at this point
Re: Action on button press and release

Is it possible to have a singular motor subject to the control of more than one button? Like, could the press of one button turn it one direction and the press of another turn it the other way? If so, how is that done?
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2011, 16:35
Wolfgang Wolfgang is offline
Registered User
AKA: Mehmed
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2010
Location: Denver
Posts: 47
Wolfgang is an unknown quantity at this point
Re: Action on button press and release

Yes, you need a case structure with 3 cases: case 0 with nothing, case 1 with forward motor, and case 2 with a backwards motor.

You merge the signal of the two buttons using a boolean array. Then you convert the boolean array value to a number using something in the boolean palette.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2011, 20:04
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Action on button press and release

Quote:
Originally Posted by M-Ross View Post
Is it possible to have a singular motor subject to the control of more than one button? Like, could the press of one button turn it one direction and the press of another turn it the other way? If so, how is that done?
Yes, this can be done. The way Mehmed posted is one option. I have attached a picture of another way you can do it.
Attached Thumbnails
Click image for larger version

Name:	2ButtonMotor.jpg
Views:	62
Size:	32.8 KB
ID:	10150  
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2011, 20:38
M-Ross M-Ross is offline
Registered User
FRC #2909
 
Join Date: Feb 2010
Location: Rochester, IN
Posts: 7
M-Ross is an unknown quantity at this point
Re: Action on button press and release

You guys are the best!

We'll give these a try and see what happens. Thanks!
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 20:29.

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