Go to Post Maybe next season I want to develop and test a new metric for FRC scouting: Bumper Quality Rating (BQR). BQR-5: The platonic ideal of FRC bumpers. ... BQR-0: Moderate to heavy use of duct tape. I believe BQR would outperform OPR as a predictor of on-field robot performance. - Nate Laverdure [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 28-01-2009, 17:11
eweathers eweathers is offline
Registered User
None #1660
 
Join Date: Jan 2009
Location: brooklyn
Posts: 1
eweathers is an unknown quantity at this point
Exclamation How do I program a relay to turn on and off by pressing a button on the joystick?

Basically I want to program a relay connected to relay port 1 to go forward by pressing button 1 (trigger) and go reverse by pressing button 2 on the joystick.


Can anyone help me program this?

Thank you in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 28-01-2009, 19:32
Geekzilla201 Geekzilla201 is offline
Alumni/Volunteer
no team (Bob's Builders in Black)
Team Role: Leadership
 
Join Date: Sep 2006
Rookie Year: 2001
Location: Tallmadge Ohio
Posts: 15
Geekzilla201 is an unknown quantity at this point
Re: How do I program a relay to turn on and off by pressing a button on the joystick?

LabVIEW or WindRiver?
__________________
Computer Science House - Rochester Institute of Technology
Reply With Quote
  #3   Spotlight this post!  
Unread 28-01-2009, 22:14
Boydean's Avatar
Boydean Boydean is offline
The Blue Alliance
no team
Team Role: Alumni
 
Join Date: Apr 2007
Rookie Year: 2003
Location: SC
Posts: 319
Boydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant futureBoydean has a brilliant future
Send a message via AIM to Boydean
Re: How do I program a relay to turn on and off by pressing a button on the joystick?

First things first. What do you really want to do. Do you want button 1 to make it forward without it being pressed down, and then backward when button 2 is pressed...so all its doing is changing the state. Or do you want it to go one way while you press button 1 and the other way while you press button 2. And its natural would be stopped.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2009, 22:29
AndrewN's Avatar
AndrewN AndrewN is offline
it's alive!
AKA: Andrew Nicholson
FRC #1778 (Chill Out)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Edmonds, WA
Posts: 48
AndrewN is just really niceAndrewN is just really niceAndrewN is just really niceAndrewN is just really niceAndrewN is just really nice
Re: How do I program a relay to turn on and off by pressing a button on the joystick?

Try something like this example in the Basic Framework:

http://www.chiefdelphi.com/forums/at...d=123319909 8

The "Off", "Forward", "Reverse" are constants created from the input to the relay "Set" VI.

The Up/Down arrows on the while loop are "Shift Registers" created using the menu on the while loop border. These are used to contain the current setting of the relay.

The T/F selectors are on the Programming Comparison Palette. These allow you to select the old value or the new one based off the buttons.

The buttons are obtained using the cluster "unbundle by name" function.
There is no button to turn the relay off ... you'll have to extend the example.

Don't forget the other cases in the main loop. The example is not complete.
Attached Thumbnails
Click image for larger version

Name:	TwoButtonRelay.gif
Views:	255
Size:	9.1 KB
ID:	7256  
__________________
Andrew Nicholson
2011 FRC Robot Inspector (Seattle, Portland)
Mentor FRC 1778 "Chill Out", FTC 3018, 3940 "Hawks", 4434 "Heat Misers"

"Everything should be made as simple as possible, but no simpler."
Reply With Quote
  #5   Spotlight this post!  
Unread 28-01-2009, 22:34
TotalChaos's Avatar
TotalChaos TotalChaos is offline
Registered User
AKA: Austin
FRC #2837 (Freebird Robotics)
Team Role: College Student
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Gilbert AZ
Posts: 112
TotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud ofTotalChaos has much to be proud of
Send a message via MSN to TotalChaos
Re: How do I program a relay to turn on and off by pressing a button on the joystick?

Quote:
Originally Posted by eweathers View Post
Basically I want to program a relay connected to relay port 1 to go forward by pressing button 1 (trigger) and go reverse by pressing button 2 on the joystick.
First off, welcome to ChiefDelphi!

Second, I've seen this exact question asked a couple of times now. I have and example VI that is documented and shows how to do this. You can download it from my post in THIS THREAD.

Good luck!

- Austin
__________________
The 39th Aero Squadron - Team 39! (Visit our website!)
Team Role: 3 Years as Driver - College Student/Mentor!


Freebird Robotics - On a 1 year hiatus! (Visit our website!)
Arizona 2009: Semifinalists! (69 and 498), Delphi "Driving Tomorrow's Technology" Award
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I Link a (group of) Joystick button(s) to a motor? CardcaptorRLH85 C/C++ 2 22-01-2009 23:23
How to program relay in labVIEW? frcchile NI LabVIEW 1 16-01-2009 13:36
Program a motor to turn on and off every other second..... programmr Programming 15 29-01-2008 10:14
How fast does the Solenoids turn on and off? Generalx5 Robotics Education and Curriculum 2 26-01-2007 01:09
Anyone know how fast the Solenoids on the MINI RC can turn on and off? Generalx5 Control System 1 06-01-2007 07:39


All times are GMT -5. The time now is 08:00.

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