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
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
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.