View Single Post
  #3   Spotlight this post!  
Unread 03-28-2016, 10:09 PM
heuristics heuristics is offline
Registered User
FRC #3634
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Trumbull, CT
Posts: 21
heuristics is on a distinguished road
Re: Autonomous not stopping. Constantly running... during enabling

Your else block is not turning the motors off. In addition, you should make your timer a member variable of the class.

Declare it outside of (usually above) your functions:
Code:
Timer myTimer;
Initialize it inside autonomousInit()
Code:
myTimer = new Timer();
myTimer.reset();
myTimer.start();
Then you can use it inside your autonomousPeriodic() function.

This way the timer will give you the time since auto mode started which is what you're looking for.

Last edited by heuristics : 03-28-2016 at 10:11 PM.
Reply With Quote