View Single Post
  #3   Spotlight this post!  
Unread 21-02-2012, 14:17
Scimor5 Scimor5 is offline
Registered User
AKA: Brett
FRC #4520 (Misfit Toys)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Post Falls
Posts: 11
Scimor5 is an unknown quantity at this point
Re: what could be wrong with this code. The robot is not responding

wow..... You seriously need to start tabbing your code and keeping track of all your brackets. Also you use while loops inapropriatly. this loop:


Code:
while(constant = true)
	{
		if (z > 0.5)
		{
			launcher.set(LAUNCH_CONSTANT * 2);
			launcherOpposite.set(LAUNCH_CONSTANT * -2);

		}
		else
		{
			launcher.set(LAUNCH_CONSTANT);
			launcherOpposite.set(LAUNCH_CONSTANT * -1);
		}
	}
never ends or updates driving, and its after this loop
Code:
while (isOperatorControl())
{
drive.tankDrive(leftStick, rightStick);
}
that ends when teleop is over, so its going to run when you dissable teleop and then never get out of it.
__________________
Good luck from team 4520