Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   labview adding button from joystick (http://www.chiefdelphi.com/forums/showthread.php?t=113852)

team4372 18-02-2013 10:14

labview adding button from joystick
 
2 Attachment(s)
Hello I am having a issues with adding a button into labview 2013. This is what i got so far in the programming I have no idea if this is even right thanks.

MotorHead 18-02-2013 10:26

Re: labview adding button from joystick
 
Assuming you initialized the joystick in the begin vi (it is if you didn't modify the default code), it looks ok.

It looks like you are checking button 1 of the joystick. If it is true (ie pressed) you stop the motor, else false you pass the values from the axis to your motor.

team4372 18-02-2013 10:30

Re: labview adding button from joystick
 
Precisely.Well the button works in the simulator and the motor stops but nothing is moving. Basically its for our launcher press button 1 and the 2 motor start and the drive motors stop.

Omar 18-02-2013 10:51

Re: labview adding button from joystick
 
It looks like you have the "drive motors stop" part, but you are missing "the 2 motor start" part.

team4372 18-02-2013 11:01

Re: labview adding button from joystick
 
1 Attachment(s)
so do i add something like this?

Omar 18-02-2013 11:09

Re: labview adding button from joystick
 
1 Attachment(s)
Try this.
Attachment 14079

Omar 18-02-2013 11:10

Re: labview adding button from joystick
 
Quote:

Originally Posted by team4372 (Post 1235602)
so do i add something like this?

The part you added goes in your Begin.vi

Omar 18-02-2013 11:20

Re: labview adding button from joystick
 
1 Attachment(s)
Add this to your Begin.VI

team4372 18-02-2013 11:31

Re: labview adding button from joystick
 
would the buttons work in the simulator? and THe robot just spins in cercles in the simulator.

team4372 18-02-2013 11:35

Re: labview adding button from joystick
 
2 Attachment(s)
here the begin and teleop updated

team4372 18-02-2013 11:41

Re: labview adding button from joystick
 
1 Attachment(s)
teleop true

Omar 18-02-2013 11:48

Re: labview adding button from joystick
 
1 Attachment(s)
To use the 2 Motor Open with a Tank drive for your launcher.

team4372 18-02-2013 11:56

Re: labview adding button from joystick
 
what value do i add in the false statement?

Omar 18-02-2013 11:57

Re: labview adding button from joystick
 
In Teleop you need to rename the two "My Motor Refnum" to "shooter 1" and shooter2".

Be VERY careful with the Ref Names string! Pay attention to spaces you use in them.

"shooter2" is not the same as "shooter 2"

In fact make it a rule not to use any spaces. Call them "shooter_1" and "shooter_2"

I should have used "Launcher_Motor_1" and "Launcher_Motor_2" in my example that I posted.

Omar 18-02-2013 12:02

Re: labview adding button from joystick
 
Quote:

Originally Posted by team4372 (Post 1235627)
what value do i add in the false statement?

For the launcher motors? What do you want the launcher motors to do when you release the joystick button?

I assume you want them the stop when you release the joystick button as write out 0 (zero)

The snipplets that I posted you can copy them to your desk top and them drag them on to any block diagram and you will have the code just as I created it.

team4372 18-02-2013 12:12

Re: labview adding button from joystick
 
it works now i forgot to add the axis in the false statement
Thanks A LOT!!


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

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