View Single Post
  #9   Spotlight this post!  
Unread 06-01-2015, 23:09
TeamMarcies TeamMarcies is offline
Registered User
FRC #4777
 
Join Date: Jun 2013
Location: Canada
Posts: 9
TeamMarcies is an unknown quantity at this point
Re: Packages/Importing problem with FRC Java

Yep! Eclipse did the trick. Thanks guys. I'll be sure to check out the command-based programming - it seems neat.

Just one quick question: Am I able to do a while(true) loop in a thread and have it persistently be doing something or will it crash the network/roboRIO?

Basically what I'm doing here:

Code:
public void run() {
        R.autonomousCounter = 0;
        while (true) {
            if ((Math.floor(R.autonomousCounter / loopsPerSecond)) < seconds) {
                if (forward) {
                    theRobot.drive(-robotDriveSpeed, gyro.getAngle() * gyroModifierSpeed);
                }else if (!forward) {
                    theRobot.drive(robotDriveSpeed, gyro.getAngle() * gyroModifierSpeed);
                }
            }else{
                break;
            }
        }
        theRobot.drive(0.0, 0.0);
    }

Last edited by TeamMarcies : 06-01-2015 at 23:12.
Reply With Quote