Go to Post It is easy to be righteous on Chief Delphi, and harder to implement in life. - DonRotolo [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
  #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
 


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 04:11.

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