labview adding button from joystick

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.







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.

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.

It looks like you have the “drive motors stop” part, but you are missing “the 2 motor start” part.

so do i add something like this?

Capture.PNG


Capture.PNG

Try this.
labview adding button from joystick.png

labview adding button from joystick.png


labview adding button from joystick.png

The part you added goes in your Begin.vi

Add this to your Begin.VI

Begin_VI.png


Begin_VI.png

would the buttons work in the simulator? and THe robot just spins in cercles in the simulator.

here the begin and teleop updated







teleop true





To use the 2 Motor Open with a Tank drive for your launcher.





what value do i add in the false statement?

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.

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.

it works now i forgot to add the axis in the false statement
Thanks A LOT!!