Try this:
Code:
Joystick *left_stick, *right_stick;
left_stick = Joystick::GetStickfromPort(1);
right_stick = Joystick::GetStickfromPort(2);
float SetValue = 0;
while(isOperatorControll()) {
SetValue = 0;
if(left_stick->GetTrigger()) SetValue = .5;
if(right_stick->GetTrigger()) SetValue = -.5;
left_steer.Set(SetValue);
right_steer.Set(SetValue);
}
I recall something about only being able to set speed controllers every (5 or 10, not sure exactly how many) milliseconds. I'm not sure if the Set method will prevent you from setting a motor speed too often, or if that is handled in the FPGA. If this is handled in the Set method, then this should work where the code you showed us didn't.