Go to Post However I did tell my wife I wanted to lose 20lbs of ugly fat quickly. She told me to cut off my head. Go figure. - Ed Coleman [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi