Go to Post We'll defenestrate our programmer, and I'll report back our solution if we get anything working. - Nick Seidl [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 27-03-2013, 23:28
Zaque Zaque is offline
FF: Bobo Brigade
AKA: Zachary H.
FRC #3352 (Flaming Monkeys)
Team Role: Programmer
 
Join Date: Mar 2013
Rookie Year: 2013
Location: Belvidere, Illinois
Posts: 91
Zaque has a spectacular aura aboutZaque has a spectacular aura aboutZaque has a spectacular aura about
Joystick button to set output

Hi,
I would like to set a button on our joystick to set a motor output to full when it is pressed, then to off when it is pressed the second time, full on 3rd press, off on 4th press, etc. Any help is greatly appreciated.
Thanks,
Zaque
Reply With Quote
  #2   Spotlight this post!  
Unread 28-03-2013, 06:41
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Joystick button to set output

It sounds like you need an edge detector and a rising edge detector.

The attached image shows that when the Boolean values are not equal, that is an edge. Either the value went false->true or true->false. In both of these you want to change the motor speed. The Greater than node indicates it was false->true and sets the motor to 1, the other sets it to zero.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	51
Size:	64.3 KB
ID:	14470  
Reply With Quote
  #3   Spotlight this post!  
Unread 28-03-2013, 11:13
Zaque Zaque is offline
FF: Bobo Brigade
AKA: Zachary H.
FRC #3352 (Flaming Monkeys)
Team Role: Programmer
 
Join Date: Mar 2013
Rookie Year: 2013
Location: Belvidere, Illinois
Posts: 91
Zaque has a spectacular aura aboutZaque has a spectacular aura aboutZaque has a spectacular aura about
Re: Joystick button to set output

Thanks for your help. I just have a quick question regarding the false case selector. I used a local variable to save the previous output and then in the false case, read from that local variable. Is this the best way to solve the "Missing Assignment to Tunnel" error, or is there a better way?
Attached Thumbnails
Click image for larger version

Name:	false case structure.PNG
Views:	26
Size:	13.3 KB
ID:	14471  
__________________
Zaque (Zach) H.
President
Programming/Electrical Lead
Reply With Quote
  #4   Spotlight this post!  
Unread 28-03-2013, 11:43
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Joystick button to set output

I'm not sure your description of what you want to do matches what Greg suggested. Are you just trying to toggle a motor between on and off each time you press a joystick button? There are plenty of posts here explaining how to do that; just search "button toggle motor". Here's one that looks particularly straightforward:

http://www.chiefdelphi.com/forums/sh...02&postcount=5
Reply With Quote
  #5   Spotlight this post!  
Unread 28-03-2013, 20:05
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Joystick button to set output

Sorry if my diagram confused you. I was using a comment for the button code and for the motor code. There is no reason to use a local if you update the motor speed inside the true case.

Greg McKaskle
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 04:30.

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