Without your current code its hard to tell what the issue is, but I would make sure that you have it in the constructor correctly. I'm going guess that its a Jaguar, but it could easily be a Victor as well.
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
Jaguar shooter;
Joystick driveStick; //it can be any name, not strictly driveStick :)
public:
RobotDemo(void):
//JAGUARS//
shooter(1), //This is what port your shooter motor is in on the Sidecar
//JOYSTICKS// // These must be initialized in the same order
driveStick(1) // as they are declared above.
{
shooter.SetExpiration(0.1); //for Driver Station
}
void Autonomous(void)
{
//where your autonomous would go
}
void OperatorControl(void) //The Operator Control, what you're looking for!
{
while (IsOperatorControl())
{
if(driveStick.GetRawButton(2)) //This is a structure that says if 2 is pressed, shooter
{ //will be set to 100%
shooter.Set(1.0);
}
else //anytime when it isn't pressed (else), the shooter will turn
{ // off
shooter.Set(0.0);
}
Wait(0.005); // wait for a motor update time
}
}
void Test()
{
//what runs during test mode
}
};
START_ROBOT_CLASS(RobotDemo);