# need help rookie

i need to make a code in labview for our gripper and i can figure out how when you press the button it’s true and when you release it’s false need help please ahahahahahahahah!

First, don’t panic. Secondly, can you describe in physical terms what you want to happen and where you’re stuck? I’m having trouble figuring out where to start helping you.

Are you trying to get one or more motors to spin in a specific direction when you push a button and stop when you let go, or something more complicated? Are you having trouble figuring out how to read a button from the joystick in Labview?

here is the vi and the motor i need it to just move one way true and the other false but it happens with like button 6

cripper.vi (9.07 KB)

cripper.vi (9.07 KB)

Here’s what I see…

• You are opening an analog port inside the while loop, which is not generally a good idea as it’s going to try to open it again every time the loop goes around.

• If your boolean is False, you are setting the motor output to 0, which is a stop.

• If the boolean is true and the voltage on the analog port is greater than 5, you are setting the motor to go forward (probably, depending on how it’s wired and physically mounted) at half speed.

• If the boolean is true and the voltage on the analog port is less than 5, you are setting the motor output to 0, which is stop.

Here is some useful information for looking at this problem:

• Analog ports supply a 5V source, so I would generally expect the signal to be less than 5V all the time.

• Motor speeds have a range of -1 to 1, with 0 being stop.

Here is what I would change:

• Move the AI Open outside the while loop

• I’m not quite sure what the analog input is measuring, but you’re going to want to change your logic a little so that cases that are likely to happen have a non-zero speed.

I hope this helps. If not, please some more questions and I’ll try again.

I believe Driver Stations automotically pull high, if so, the button reads values true until false (when pushed).

You can check this by running the code direct off of labview and probing the wires in the teleop and looking at what it reads. Do this by opening the driver station in developer, opening Main.vi in the project list and pushing the little arrow at the top left of the front pannel and running as normal. While the code is running, you can click on wires in your other vis and see the values they read.