If you look in the SimpleRobot example class it shows a joystick defined:
Code:
Joystick *joystickname;
//then later:
joystickname = new Joystick (1) //where "1" is, is the USB port on the Driver Station in which the joystick is plugged into.
//then in your teleop code:
if (joystickname -> GetRawButton(button #)){
//put code here for which motor to run
}
Of course this is with WindRiver and C++, LabView you will need someone else's help on
EDIT:
Saw your other thread.
This code will make it so when you hold a button down the specified motor runs.
If you want it so one button sends it forward, and another backward, its the same thing, just another if statement. (in one if statement, set the motor to a value of 1 (makes it go forward full speed), then in the other if statement, set the motor to a value of -1 (full speed in reverse)
If you want it so you only have to press the button once for it to start, then again for it to stop, you need to create a boolean for the motor running, and have the button set it true or false.