本文整理汇总了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);
}