本文整理汇总了Java中edu.wpi.first.wpilibj.DoubleSolenoid.Value类的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Value类属于edu.wpi.first.wpilibj.DoubleSolenoid包,在下文中一共展示了Value类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tick
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void tick() {
PortcullisLiftSubsystemMode mode = (PortcullisLiftSubsystemMode) this.getMode();
switch(mode) {
case RAISING:
this._lift.set(Value.kForward);
break;
case LOWERING:
this._lift.set(Value.kReverse);
break;
case DISABLED:
case STOPPED:
default:
this._lift.set(Value.kOff);
break;
}
}
示例2: initialize
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
protected void initialize() {
if (RobotMap.pneumaticsSolenoidRight.get() == false) {
if (RobotMap.pneumaticsDoubleSolenoidCClamps.get() == DoubleSolenoid.Value.kReverse) {
RobotMap.pneumaticsDoubleSolenoidCClamps.set(DoubleSolenoid.Value.kForward);
endTime = System.currentTimeMillis() + 500;
sentinel = true;
} else
RobotMap.pneumaticsSolenoidRight.set(true);
RobotMap.pneumaticsSolenoidLeft.set(false);
} else {
if (RobotMap.pneumaticsDoubleSolenoidCClamps.get() == DoubleSolenoid.Value.kReverse) {
RobotMap.pneumaticsDoubleSolenoidCClamps.set(DoubleSolenoid.Value.kForward);
endTime = System.currentTimeMillis() + 500;
otherSentinel = true;
} else
RobotMap.pneumaticsSolenoidRight.set(false);
RobotMap.pneumaticsSolenoidLeft.set(true);
}
}
示例3: Puncher
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
private Puncher()
{
try
{
winch = new CANJaguar(RobotMap.WINCH_JAG);
winch.configPotentiometerTurns(1);
winch.setPositionReference(CANJaguar.PositionReference.kPotentiometer);
winch.setSafetyEnabled(false);
setWinchLimit(.95f);
}
catch (CANTimeoutException ex)
{
reportCANException(ex);
}
dogEar = new DoubleSolenoid(RobotMap.DOG_EAR_SOLENOID_DEPLOY, RobotMap.DOG_EAR_SOLENOID_UNDEPLOY);
dogEar.set(Value.kReverse);
}
示例4: toggleManipulator
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void toggleManipulator() {
Value solenoidVal = manipulatorSolenoid.get();
if (solenoidVal == Value.kForward) {
manipulatorSolenoid.set(DoubleSolenoid.Value.kReverse);
} else {
manipulatorSolenoid.set(DoubleSolenoid.Value.kForward);
manipulatorMotor.set(0.5);
}
}
示例5: setGear
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
/**
* Set the current gear of the transmission. If we have a
* physical transmission and we set it within that gear range,
* we adjust the solenoid accordingly.
*
* @param gear
* new gear to set the transmission to
*
* @author Noah Golmant
* @written 16 July 201
*/
public void setGear (int gear)
{
if ((gear < 1) || (gear > this.MAX_GEAR))
{
if ((this.getDebugState() == DebugState.DEBUG_MOTOR_DATA) ||
(this.getDebugState() == DebugState.DEBUG_ALL))
{
System.out.println("Failed to set gear " + gear +
"in setGear()");
}
return;
}
this.gear = gear;
// check for a physical transmission
if (this.transmissionSolenoids != null)
{
switch (gear)
{
case 1:
this.transmissionSolenoids.set(Value.kForward);
break;
case 2:
this.transmissionSolenoids.set(Value.kReverse);
break;
default:
this.transmissionSolenoids.set(Value.kOff);
break;
}
}
}
示例6: autonomousInit
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void autonomousInit() {
encLeftDrive.reset();
navx.reset();
autoSelected = chooser.getSelected();
System.out.println("Auto selected: " + autoSelected);
state = 0;
condition = 0;
gearpiston.set(Value.kReverse);
}
示例7: autonomous
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void autonomous() {
String choose = chooser.getSelected();
Skylar.setSafetyEnabled(false);
OptimusPrime.setSafetyEnabled(false);
switch (choose) {
case pos1:
case pos2:
while (isAutonomous() && isEnabled()) {
timer = System.currentTimeMillis();
while (System.currentTimeMillis() - timer <= 3000) {
adjustedDrive(0.5, 0.5);
}
smashDrive(0, 0);
getSensorData();
gearBox.set(Value.kReverse);
Timer.delay(2);
timer = System.currentTimeMillis();
while (System.currentTimeMillis() - timer <= 1000) {
adjustedDrive(-0.5, -0.5);
}
smashDrive(0, 0);
getSensorData();
gearBox.set(Value.kForward);
break;
}
case pos3:
}
}
示例8: gearBox
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void gearBox() {
if (stick.getRawButton(5)) {
gearBox.set(Value.kReverse);
}
if (stick.getRawButton(6)) {
gearBox.set(Value.kForward);
}
}
示例9: switchPos
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void switchPos() {
switch (solenoid.get()) {
case kOff: case kReverse:
solenoid.set(Value.kForward);
break;
case kForward:
solenoid.set(Value.kReverse);
break;
}
}
示例10: toggleAManipulators
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void toggleAManipulators() {
Value solenoidVal = aManipulatorSolenoid.get();
if (solenoidVal == Value.kReverse) {
aManipulatorSolenoid.set(DoubleSolenoid.Value.kForward);
} else {
aManipulatorSolenoid.set(DoubleSolenoid.Value.kReverse);
}
}
示例11: toggleIntakeSolenoid
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void toggleIntakeSolenoid() {
Value SolenoidVal = Actuator.get();
if (SolenoidVal == Value.kForward) {
lowerRake();
} else {
raiseRake();
}
}
示例12: run
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void run() {
if(xbox.getStart()){
solenoid.set(Value.kForward);
}else{
solenoid.set(Value.kReverse);
}
}
示例13: runAuto
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void runAuto(double distance, double speed, boolean useSensor) {
if(speed == 0){
solenoid.set(Value.kReverse);
}else if(speed == 1){
solenoid.set(Value.kForward);
}else{
solenoid.set(Value.kOff);
}
}
示例14: run
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void run() {
if(controller.getRawButton(3)){ //Press button X
solenoid.set(Value.kForward);
solenoid2.set(Value.kForward);
isOpen = true;
}else if(controller.getRawButton(4)){ //Press button Y
solenoid.set(Value.kReverse);
solenoid2.set(Value.kReverse);
}else{
solenoid.set(Value.kOff);
solenoid2.set(Value.kOff);
isOpen = false;
}
}
示例15: runAuto
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
@Override
public void runAuto(double distance, double speed, boolean useSensor) {
if(speed == SOLENOID_OFF){
solenoid.set(Value.kReverse);
}else if(speed == SOLENOID_ON){
solenoid.set(Value.kForward);
}else{
solenoid.set(Value.kOff);
}
}