本文整理匯總了Java中edu.wpi.first.wpilibj.Compressor.setClosedLoopControl方法的典型用法代碼示例。如果您正苦於以下問題:Java Compressor.setClosedLoopControl方法的具體用法?Java Compressor.setClosedLoopControl怎麽用?Java Compressor.setClosedLoopControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edu.wpi.first.wpilibj.Compressor
的用法示例。
在下文中一共展示了Compressor.setClosedLoopControl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: robotInit
import edu.wpi.first.wpilibj.Compressor; //導入方法依賴的package包/類
@Override
public void robotInit() {
logger = LoggerFactory.getLogger(Robot.class);
logger.info("Initializing Robot");
drivetrain = new DriveTrain();
driveEncoders = new DriveEncoders(RobotMap.leftEncoderA,RobotMap.leftEncoderB,RobotMap.rightEncoderA, RobotMap.rightEncoderB,
RobotMap.encoderMaxPeriod, RobotMap.encoderMinRate, RobotMap.encoderDPP,RobotMap.encoderReverseDirection,RobotMap.encoderSamplesToAvg);
ultrasonic = new Ultrasonic(RobotMap.valueToInches,RobotMap.ultrasonicPort);
gyro = new Gyro();
vision = new Vision();
gds = new GDS();
pickup = new Pickup();
flywheel = new Flywheel();
meter = new Meter();
winch = new Winch();
winchPush = new WinchPush();
fieldTimer = new FieldTimer();
oi = new OI();
chooser = new SendableChooser<>();
endTimer = new StartEndTimer();
stopTimers = new StopEndTimer();
vision.setUpCamera();
SmartDashboard.putData(drivetrain);
chooser.addDefault("None", noAuto);
chooser.addObject("Forward Drive", forwardAuto);
chooser.addObject("Center Gear Blue", centerGearAuto);
chooser.addObject("Left Gear", leftGearAuto);
chooser.addObject("Right Gear", rightGearAuto);
chooser.addObject("Boiler Red", boilerAuto);
chooser.addObject("Center Gear Only",centerGearOnlyAuto);
chooser.addObject("Boiler Blue", boilerAutoBlue);
chooser.addObject("Center Gear Red", centerGearRed);
SmartDashboard.putData("Auto choices", chooser);
Compressor c = new Compressor(10);
c.setClosedLoopControl(true);
gyro.calibrate();
winchPush.setLock(false);
}
示例2: Pneumatics
import edu.wpi.first.wpilibj.Compressor; //導入方法依賴的package包/類
/**
* Creates a new Pneumatics subsystem.
*/
public Pneumatics() {
logger.info("Initialize");
if (Robot.deviceFinder.isPcmAvailable(RobotMap.PCM_CAN_ID)) {
compressor = new Compressor(RobotMap.PCM_CAN_ID);
compressor.setClosedLoopControl(true);
}
}
示例3: Pneumatics
import edu.wpi.first.wpilibj.Compressor; //導入方法依賴的package包/類
/**
* Constructor
*/
private Pneumatics() {
shifter = new DoubleSolenoid(1, SHIFTER_EXT, SHIFTER_RET);
comp = new Compressor(1);
comp.setClosedLoopControl(true);
shifter.set(DoubleSolenoid.Value.kForward);
shifter.set(DoubleSolenoid.Value.kOff);
}
示例4: initialize
import edu.wpi.first.wpilibj.Compressor; //導入方法依賴的package包/類
@Override
public void initialize() {
m_compressor = new Compressor();
m_compressor.setClosedLoopControl(true);
m_solenoid = new DoubleSolenoid(RobotMap.SOLENOID_PCM_PORT1,
RobotMap.SOLENOID_PCM_PORT2);
}