View Single Post
  #2   Spotlight this post!  
Unread 01-03-2014, 08:07
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: URGENT:Auto Problem trying to fix before tomorrow

Quote:
Originally Posted by miw14 View Post
Thank you! I am a little bit confused though. You said time is in miliseconds, but it seemed like the Timer.delay worked fine with seconds with the mydrive.

Another question about the code. For the time conditions in the else statements, are the last two statements supposed to be greater than signs instead of less than signs? *Nevermind, I believe I understand this now.

Lastly, what do you think was the problem with the original code?
Sorry I should clarify. My time was in mills, hence the System.currentTimeMills(). Delay is in seconds. So the delay is 100th of a second in my case where as the first segment is 3500 mills.

Yes, putting a greater than time would be redundant in this case. The second if (first else if) can only occur if its >= 3500 mills, as the first if reserves behavior from 0 to 3499 mills.

Sounds like you understood this, but I just wanted to make sure I conveyed it a little better.
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote