Quote:
Originally Posted by 2869Robotics
Im not sure what you guys mean by running it in a seperate thread
|
Having a separate thread makes it so that your code won't be stuck on some piece of code until it finishes running. It makes it so that it can run multiple pieces of code (technically no on the low level, but for all practical purposes yes).
If you don't stick a piece of particularly long running loop in a thread (say, one that deliberately waits for 5 seconds before it finishes executing), the rest of your program will get stuck on it, and your other code, like your drive/shoot code will stop executing until the 5 seconds is done.
Read this piece of documentation on how you can implement this in Java:
http://docs.oracle.com/javase/tutori...l/concurrency/