Go to Post "FIRST: We take young human beings, born in captivity, educate them in science and technology, and re-release them into the wild." - kmcclary [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 17-07-2010, 22:13
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
[need help] push button cylinder/game pad controller

i want to be able to push a button on a joystick and have the cylinder fire and stay out without having to keep the button pushed. also another thing i would like to do is use a non-joystick input device for driving and all i can find in labview is a joystick vi. do i just have to call it a joystick and point it to the usb port it is plugged into or is there something more to it? Any help is appreciated.

Thanks!

Cory S.
~Team 1529~
__________________
~Team 1529 Cybercards~
Reply With Quote
  #2   Spotlight this post!  
Unread 17-07-2010, 22:53
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

Maybe something like this?
A shift register works as well.

The joystick.vi works with any standard game controller, such as a steering wheel or an xbox controller.
Attached Thumbnails
Click image for larger version

Name:	SolenoidToggle.jpg
Views:	52
Size:	16.4 KB
ID:	9208  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-07-2010 at 22:57.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-07-2010, 22:58
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: [need help] push button cylinder/game pad controller

Thanks! i haven't seen some of those symbols before, but i will take a look and tinker with it. thank you very much for a quick response!

Cory S.
__________________
~Team 1529 Cybercards~
Reply With Quote
  #4   Spotlight this post!  
Unread 17-07-2010, 23:05
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

They're all on the Programming sub-palettes.

Probably the most unusual one is the:
Programming -> Structures -> Feedback Node

It stores a value from one vi call to the next, so your code can remember what happened last time.

The button will toggle. One push will set the solenoid to on, the next push will set it to off.

The easiest way to identify game controller buttons is using the Windows utility
Start -> Control Panel -> Game Controllers
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-07-2010 at 23:08.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-07-2010, 23:13
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

That's the one called a Feedback Node.
You'll see it in the palette as just an arrow, but when you paste it into a block diagram it'll have the diamond underneath it. The diamond is a way to set the initial value you want it to start with.

After you place a feedback node it will be black and you won't be able to do much with it until you tell it what data type it will be saving for you.
Follow up by adding a Boolean True or False from the Programming palette and wire it to the diamond. Then the Feedback Node will turn green, the color of boolean data types. That is what the Solenoids are expecting as inputs to the Set vi.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-07-2010 at 23:20.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-07-2010, 23:22
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

If you use a double solenoid, it does it automatically.
Reply With Quote
  #7   Spotlight this post!  
Unread 17-07-2010, 23:24
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: [need help] push button cylinder/game pad controller

it is a little messy, but should this work?
http://img685.imageshack.us/f/togglepiston.png/


Cory S.
__________________
~Team 1529 Cybercards~
Reply With Quote
  #8   Spotlight this post!  
Unread 17-07-2010, 23:28
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

You just need to add the False CASE.
That's a wire straight through from the tunnel on the left to the tunnel on the right.
Seems fine otherwise.
Attached Thumbnails
Click image for larger version

Name:	SolenoidToggle.jpg
Views:	31
Size:	22.5 KB
ID:	9209  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #9   Spotlight this post!  
Unread 17-07-2010, 23:33
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: [need help] push button cylinder/game pad controller

I don't follow. i just added a wire from the diamond pointing left to the true/false (currently false) toggle switch thing.
__________________
~Team 1529 Cybercards~
Reply With Quote
  #10   Spotlight this post!  
Unread 17-07-2010, 23:46
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

In the picture you posted there is a hollow green box (called a tunnel) on the right side of the CASE structure. I circled it in a copy of your photo below.

When it's hollow like that it means you haven't attached it in all the CASES, so it's incomplete. You'll also see there's a broken arrow for the vi in the upper left menu bar.
You've done the TRUE case, but you need to switch it to the FALSE case and just connect a wire across from the left green box to the right green box.
Attached Thumbnails
Click image for larger version

Name:	togglepiston.jpg
Views:	30
Size:	71.8 KB
ID:	9210  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #11   Spotlight this post!  
Unread 18-07-2010, 00:01
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: [need help] push button cylinder/game pad controller

ohh, thanks. i just added that and i have no errors now. thanks for the help! There is one more thing i'm trying to figure out. I don't know how to run the compressor in autonomous mode. Is that a complicated process or is it simple? i can't find any threads about that. I tried to do the same thing i did in teleop but it didn't work. you can see the teleop compressor code labeled GAS in the picture I posted.

Thanks again for all your help. I hope to learn as much as i can about labVIEW and programming before the next build season so the programming skill is not restricting to the robot's capabilities. You have helpedme alot!

Cory S.
__________________
~Team 1529 Cybercards~
Reply With Quote
  #12   Spotlight this post!  
Unread 18-07-2010, 00:09
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: [need help] push button cylinder/game pad controller

The compressor code belongs in Begin.vi, so that it's active all the time to support both Auto and Teleop.

Here's a link to an example of how you start it in Begin.vi: http://team358.org/files/programming...orExample2.jpg


There are some other examples on that page you might find useful: http://team358.org/files/programming...2009-/LabVIEW/
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #13   Spotlight this post!  
Unread 17-07-2010, 23:05
3p1c w1n 3p1c w1n is offline
Registered User
FRC #1529
 
Join Date: Jan 2010
Location: Indianapiolis
Posts: 53
3p1c w1n is an unknown quantity at this point
Re: [need help] push button cylinder/game pad controller

same button will fire as well as retract the cylendars, right? I'm at home and dont have a robot to test code on.

another thing. how could you tell what buttons are what on a game pad, ie. Button 1 = (Left Trigger)on xbox-like controller? is there a simple way to test what button is what?


Cory S.
__________________
~Team 1529 Cybercards~
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
Normal IO Push Button on the Digital Sidecar DaSavageJ Electrical 4 07-02-2010 17:43
Driver Station Push Button coolperson987 General Forum 6 12-03-2009 22:17
Automation Direct Push Button MPG Electrical 2 19-02-2009 22:56
Push Button System Rob2713g Programming 5 08-08-2006 21:20
push-button switch on robot Conan Electrical 4 10-02-2006 22:03


All times are GMT -5. The time now is 22:04.

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