本文整理汇总了Java中edu.wpi.first.wpilibj.Timer.reset方法的典型用法代码示例。如果您正苦于以下问题:Java Timer.reset方法的具体用法?Java Timer.reset怎么用?Java Timer.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.Timer
的用法示例。
在下文中一共展示了Timer.reset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例3: 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();
}
示例4: 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};
}
示例5: initialize
import edu.wpi.first.wpilibj.Timer; //导入方法依赖的package包/类
protected void initialize() {
timer = new Timer();
timer.reset();
timer.start();
}
示例6: 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;
}