本文整理匯總了Java中edu.wpi.first.wpilibj.Timer.start方法的典型用法代碼示例。如果您正苦於以下問題:Java Timer.start方法的具體用法?Java Timer.start怎麽用?Java Timer.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edu.wpi.first.wpilibj.Timer
的用法示例。
在下文中一共展示了Timer.start方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
@Override
protected void initialize() {
Robot.drive.resetGyro();
timer = new Timer();
timer.reset();
timer.start();
}
示例2: ToggleShooter
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
public ToggleShooter() {
super("ToggleShooter");
timer = new Timer();
timer.start();
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
示例3: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
protected void initialize() {
Timer timer = new Timer();
timer.start();
while(!timer.hasPeriodPassed(.5)){
Robot.drive.setspeed(.4);
Robot.arm.setarm(0.22);
}
Robot.drive.setspeed(0);
Robot.arm.setarm(0);
timer.stop();
timer.reset();
timer.start();
while(!timer.hasPeriodPassed(.5)){
Robot.arm.setarm(0.3);
}
Robot.arm.setarm(0);
timer.stop();
timer.reset();
/*
while(!timer.hasPeriodPassed(2)){
Robot.drive.setspeed(.7);
Robot.arm.setarm(-0.1);
}
Robot.drive.setspeed(0);
timer.stop();
timer.reset();
*/
endCommand = true;
}
示例4: PositionDataPoint
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
/**
* Creates a new PositionDataPoint and starts its timer.
*
* @param val
* the value at time of creation
*/
public PositionDataPoint(double val) {
this.value = val;
time = new Timer();
time.reset();
time.start();
}
示例5: calibrateAngle
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
public double[] calibrateAngle()
{
double max = 0;
double min = 10;
Timer t = new Timer();
t.reset();
t.start();
angle.changeControlMode(TalonControlMode.PercentVbus);
PIDSet();
PIDc.setSetpoint(0);
while(t.get() <= 5)
{
if(encoder.getVoltage() > 0.25 && encoder.getVoltage() < 0.75)
{
encFake.pidSetAbsolute(encoder.pidGet());
PIDc.setSetpoint(4.6);
}
else if(encoder.getVoltage() < 4.8 && encoder.getVoltage() > 4.5)
{
encFake.pidSetAbsolute(encoder.pidGet());
PIDc.setSetpoint(0.35);
}
else if(encoder.getVoltage() < 4.5 && encoder.getVoltage() > .75)
{
encFake.pidSetAbsolute(encoder.pidGet());
PIDc.setSetpoint(0);
}
if(encoder.getVoltage() > max)
{
max = encoder.getVoltage();
}
if(encoder.getVoltage() < min)
{
min = encoder.getVoltage();
}
}
angle.set(0);
angle.setControlMode(0);
return new double[] {min,max};
}
示例6: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
protected void initialize() {
timer = new Timer();
timer.reset();
timer.start();
}
示例7: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
@Override
protected void initialize() {
timer = new Timer();
timer.start();
}
示例8: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
protected void initialize() {
Timer timer = new Timer();
timer.start();
//get to low bar and lower arm
while(!timer.hasPeriodPassed(2)){
Robot.drive.setspeed(-0.5);
Robot.arm.setarm(0.1);
}
Robot.arm.setarm(0);
timer.stop();
timer.reset();
//////////////////////////////////////
timer.start();
//move under bar
while(!timer.hasPeriodPassed(1.7)){
Robot.drive.setspeed(-.7);
}
timer.stop();
timer.reset();
Robot.drive.setspeed(0);
////////////////////////////////////////
timer.start();
//spin to shoot
while(!timer.hasPeriodPassed(0.6)){
Robot.drive.spinright(1);
}
timer.stop();
timer.reset();
Robot.drive.setspeed(0);
////////////////////////////////////////
/*
timer.start();
//raise shooter
while(!timer.hasPeriodPassed(6)){
Robot.aim.shooterForward();
}
timer.stop();
timer.reset();
Robot.aim.stopaim();
*/
//////////////////////////////////////////
//spin up motors and fire
Robot.shooter.speedmotors();
Timer.delay(2.5);
Robot.shooter.plunger();
Timer.delay(1);
Robot.shooter.stopplunger();
Robot.shooter.stopshooter();
endCommand = true;
}
示例9: initialize
import edu.wpi.first.wpilibj.Timer; //導入方法依賴的package包/類
protected void initialize() {
localTimer = new Timer();
localTimer.start();
}