Labview Invert Motors with Push of Button

Hey all,

I’m starting to work on the programming for this year’s bot on our old robot. We plan on using an arcade drive for the new bot, and the old one also has an arcade drive.

This year we are thinking of having the ability to invert the drive system when a button is pushed. Basically switch forward and back. The system would work where the robot would be operated like normal moving the joystick forward/back/left/right, but when a button is pushed and held down, it inverts the motors swapping forward and backward.

I tried this before by making two of the same drive configurations in the begin.vi, but one having a different name and opposite true/false values on the inverts. Then in teleop.vi, I made a case structure with the joystick on the outside. I took button 7 and wired it to the case structure. When the case was false I put my original drive configuration in, and when true put the new one in. The code ran, but didn’t work as planned.

When the button was not held down, and the joystick was moved, nothing occured with the robot. No wheels moving. But when the button was held, the motors spun.

How can I go about doing this? Any help would be greatly appreciated.
Thanks

Might be a good idea to post either the VI in question and/or a screenshot of said VI.

I’m not a LabVIEW guy myself, just noting that we’ll need to see what exactly you are looking at.

I just left our workplace a little while ago. I can post it sometime tomorrow when I get back there.

You would not need to use 2 separate configurations. In the teleop VI, you would put a switch statement between the joystick and the motors. then you would connect a button to the switches. similar to the screenshot below

button switch.PNG


button switch.PNG

That is extremely helpful. But how would I make the button invert the motors?

it looks like in the picture that if the button is pressed (true) that the values coming from the joystick are multiplied by -1.

Yea I realized that after I replied already. I’ll try this tomorrow and let you all know how it works.

Thanks all you guys!

please do, this in a great idea and I’m planning on implementing it as well on this years’ bot.

Yea it’s a smart idea. My friend thought of it yesterday as it would increase our driving efficiency. It is basically so when we want to pick up balls we can drive in the direction the slot will be rather than driving backwards.