The code for this task varies depending on what template you are using: SimpleRobot, IterativeRobot, or Command Based. If you're using SimpleRobot or IterativeRobot, just add a Talon to your robot class...
Code:
private Talon pickupMotor = new Talon(1);
...and then in your teleop code check the joystick buttons and set the Talon accordingly
Code:
// inside operatorControl() or teleopPeriodic()
// assuming there is already a Joystick object named 'joystick'
if (joystick.getRawButton(1))
pickupMotor.set(1.0);
else if (joystick.getRawButton(2))
pickupMotor.set(-1.0);
else
pickupMotor.set(0.0);
With the Command Based pattern, you'll want to add the Talon to your pickup subsystem, create a command(s) to set the motor, and then bind your commands to buttons in the OI class.