View Single Post
  #2   Spotlight this post!  
Unread 04-02-2017, 16:22
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 118
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Timer.Delay stops motor movement?

Is "arcadeDrive" an instance of a RobotDrive? If so, did you disable the motor safety feature? If not, the speed controllers will think that they are no longer being controlled when your Timer.delay() pauses. This will cause the watchdog to time out and disable all of the drive motors.

Here is an example of turning off the motor safety feature while driving autonomously:

Code:
case leftAuto:
                        // Disable watchdog when autonomous driving
                        arcadeDrive.setSafetyEnabled(false);

			System.out.print("YOU'RE LEFT");
			Timer.delay(2.5);
			arcadeDrive.drive(1, 0);
			Timer.delay(5);
			arcadeDrive.drive(0.75, .6);
			Timer.delay(3);
			solenoid2.set(DoubleSolenoid.Value.kForward);
			Timer.delay(2);
			solenoid2.set(DoubleSolenoid.Value.kReverse);
			arcadeDrive.drive(-1, .8);
			Timer.delay(4.8);
			arcadeDrive.drive(-.25, 0);
			Timer.delay(2);

                        // WARNING! It looks like you leave the motors running! Is that what
                        // you want? Or, would it be better to stop at this point?
                        //arcadeDrive.drive(0, 0);

                        // Enable watchdog on driving again
                        arcadeDrive.setSafetyEnabled(true);
			break;
Reply With Quote