Like this?
Code:
void OperatorControl(void)
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl())
{
myRobot.ArcadeDrive(rightstick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
//pressing 6 will turn on intake, releasing 6 will stop intake
if(rightstick->GetRawButton(6) == 1)
{
Intakevictor->Set(.7f);
}
else if(rightstick->GetRawButton(6) == 0)
{
Intakevictor->Set(0.0f);
}
}
}
};
START_ROBOT_CLASS(RobotDemo);
Or Like this
Code:
void OperatorControl(void)
{
myRobot.SetSafetyEnabled(true);
while (IsOperatorControl())
{
myRobot.ArcadeDrive(rightstick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
}
//pressing 6 will turn on intake, releasing 6 will stop intake
if(rightstick->GetRawButton(6) == 1)
{
Intakevictor->Set(.7f);
}
else if(rightstick->GetRawButton(6) == 0)
{
Intakevictor->Set(0.0f);
}
}
};
START_ROBOT_CLASS(RobotDemo);