Re: Button programin C++
void OperatorControl(void)
{
myRobot.SetSafetyEnabled(true);
AxisCamera &robocam = AxisCamera::GetInstance();
robocam.WriteResolution((AxisCamera::Resolution_t) 3);
robocam.WriteBrightness(0);
Wait(3.0);
while (IsOperatorControl())
{
if (!leftstick.GetTrigger()){
myRobot.MecanumDrive_Cartesian(leftstick.GetX(), leftstick.GetY(), rightstick.GetY(), 0);// mecanum drive at full speed
}
else{
myRobot.MecanumDrive_Cartesian(leftstick.GetX()/2, leftstick.GetY()/2, rightstick.GetY()/2, 0);// mecanum drive at full speed
}
robocam.GetImage();
image.GetImaqImage();
Wait(0.005); // wait for a motor update time
}
Try this for your OperatorControl function. This should work for you. And have fun with the mecanum drive, it's alot of fun once you get used to driving it.
|