Go to Post If they ask you to stop - you stop. - techhelpbb [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
  #1   Spotlight this post!  
Unread 28-03-2014, 21:26
Accentuate's Avatar
Accentuate Accentuate is offline
Registered User
FRC #4587 (Jersey Voltage)
Team Role: Programmer
 
Join Date: Jul 2013
Rookie Year: 2013
Location: Houston, TX
Posts: 2
Accentuate is an unknown quantity at this point
Java Timer.delay help

So we are trying to move away from Timer.Delay in our robot code because we are aware of the lag it brings to the whole robot when we are trying to reload the shooter. I am trying to find a way to implement a wait function with the Timer.getFPGATimestamp, but I'm drawing blanks on how to implement it.

I'm postulating that I'd have to implement by resetting the timer, then implementing something like this:
Quote:
public boolean hasPeriodPassed(double period) {
if (timer.getFPGATimestamp() < period * 1000000) {
return true;
}
else {
return false;
}
}
}
But we got no results when we tried it like this.

An example of where we implement Timer.delay looks like this:
Quote:
public void Fire() {
IntakeDown.set(false);
IntakeUp.set(true);
isIntakeUp = true;
Timer.delay(0.25);
shooterLatch.set(false);
shooterUnlatch.set(true);
Timer.delay(1.0);
isLatched = false;
isBottom = false;
isReset = false;
isFired = true;

}
If someone could point me in the right direction, it would be greatly appreciated.
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 11:44.

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