How to assign buttons?

I am the only programmer on my team and am completely lost.

I have the camera with 2 servos(mounted), but I want to make it able to move the servos with joystick buttons. I want to use buttons 2,3,4,5.

Can you let us know what language you are using?

I’m going to assume he posted in the right forum and is using Labview.

What do you want the buttons to do to the servo positions? Do you want them to move the servos to some setpoint? Or increment the servo position some amount in a given direction?

Are you starting with the 2010 Sample code? If so, it already reads several joystick buttons. The computer I’m at doesn’t have the latest code installed, but if you open the TeleOp.vi file and go to the diagram, you can follow where the joystick wire leads. It may be easiest to drop another Joystick Get function and unbundle the buttons. Wire the buttons to case structures that add, subtract, or leave the desired servo angle alone. Then wire the angle to the servo.

If you haven’t already done it, you’ll want to add the Servo Opens to Begin.vi, store the value under some named entries, and read the refnum back in TeleOp.vi.

If you are not sure what something does, open and read examples. Also, much of what you need is in the WPILib section of the menu, towards the bottom.

Greg McKaskle