Mapping buttons on a configured joystick to new motors

Hello all and thank you in advance for your help and advice.

I am part of team 4347 and we are all rookies. We decided to go with labView but will probably tinker in C++ as well.

My question here pertains to LabView. I have sample code that I have uploaded and I am confused on how to map buttons on a currently configured joystick to conrol a new servo or motor.

The joystick axis was originally set to control a two motor device, I changed it to control mechanum wheels. (I still must modify this control systyem when my wheels come in, as you will see from my rotation value of 0) In the sample code there was no set up for using buttons and I was unable to find good documents online.

Would someone be able to help me create/map a button to a new motor? I would like to have one button turn the motor to the right, and another to turn it to the left.

My current coding problem is in the TeleOp Vi

Thank you in advance for all your help.

James

2012 Robot Project.zip (211 KB)


2012 Robot Project.zip (211 KB)

Use WPI_JoystickGet.vi it has both the joystick axis and buttons output

There are examples you get to fronm the LabVIEW Getting Started Window (the first screen to appear when you start LabVIEW or you can bring it up by going to View -> Getting Started Window… from any of the project windows.
From the Getting Started Window go to:

  • Support
    on the left-hand menu - Find FRC Examples…
  • FRC Robotics
    on the example list - Joystick
    Here’s how you breakout joystick buttons for use.