View Single Post
  #7   Spotlight this post!  
Unread 02-05-2012, 12:45
tyandjel94 tyandjel94 is offline
Registered User
FRC #1647 (Iron Devils)
Team Role: Programmer
 
Join Date: Apr 2012
Rookie Year: 2009
Location: New Jersey
Posts: 14
tyandjel94 is an unknown quantity at this point
Re: Multitasking in Java

Ok so in each runnable just put while(true). Could you also put while(isTeleop())?

Code:
Runnable driveJob = new Runnable()
    {

	RobotDrive myDrive = new RobotDrive(1, 2, 3, 4);

	public void run()
	  {
                  while(true)
                     {
	             myDrive.tankDrive(-stickL.getAxis(Joystick.AxisType.kY), -stickR.getAxis(Joystick.AxisType.kY));
                     }
	  }

    };
If you are sending information from the laptop to the robot through udp, can you put a thread in and the robot won't get caught somewhere. So you will still be able to drive and run conveyors and shoot the ball.

Thanks
__________________
-Tyler
Team 1647 Iron Devils
Reply With Quote