View Single Post
  #13   Spotlight this post!  
Unread 23-01-2011, 20:15
DiscoKittyPrime DiscoKittyPrime is offline
Registered User
AKA: Joshua Bryant
FRC #0057 (Leopards)
Team Role: Programmer
 
Join Date: Dec 2010
Rookie Year: 2003
Location: Houston, Tx
Posts: 26
DiscoKittyPrime will become famous soon enough
Talking 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.
Reply With Quote