View Single Post
  #8   Spotlight this post!  
Unread 02-05-2012, 14:49
Sunstroke Sunstroke is offline
Programmer
AKA: Joe Grinstead
FRC #3504 (Girls of Steel)
Team Role: Mentor
 
Join Date: Apr 2009
Rookie Year: 2009
Location: New England
Posts: 49
Sunstroke is an unknown quantity at this point
Re: Multitasking in Java

Quote:
Originally Posted by tyandjel94 View Post
Code:
while(true)
{
    myDrive.tankDrive(-stickL.getAxis(Joystick.AxisType.kY),-stickR.getAxis(Joystick.AxisType.kY));
}
Watch out, that while loop has the potential to freeze the code because it never rests, you need to put some kind of Thread.sleep(...) in there.

Alternatively, you could try to figure out the Command System which is better for doing the kind of job you've written down (although for UDP stuff, you'll have to use a thread).
Reply With Quote