Log in

View Full Version : labview adding button from joystick


team4372
18-02-2013, 10:14
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
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
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
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
so do i add something like this?

Omar
18-02-2013, 11:09
Try this.
14079

Omar
18-02-2013, 11:10
so do i add something like this?

The part you added goes in your Begin.vi

Omar
18-02-2013, 11:20
Add this to your Begin.VI

team4372
18-02-2013, 11:31
would the buttons work in the simulator? and THe robot just spins in cercles in the simulator.

team4372
18-02-2013, 11:35
here the begin and teleop updated

team4372
18-02-2013, 11:41
teleop true

Omar
18-02-2013, 11:48
To use the 2 Motor Open with a Tank drive for your launcher.

team4372
18-02-2013, 11:56
what value do i add in the false statement?

Omar
18-02-2013, 11:57
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
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
it works now i forgot to add the axis in the false statement
Thanks A LOT!!