当前位置: 首页>>代码示例>>Java>>正文


Java Value类代码示例

本文整理汇总了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;
	}
}
 
开发者ID:frc2503,项目名称:r2016,代码行数:21,代码来源:PortcullisLiftSubsystem.java

示例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);
	}
}
 
开发者ID:FRC2832,项目名称:Robot_2015,代码行数:21,代码来源:ToggleIngestors.java

示例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);
}
 
开发者ID:Nashoba-Robotics,项目名称:NR-2014-CMD,代码行数:18,代码来源:Puncher.java

示例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);
	}

}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:11,代码来源:GearManipulator.java

示例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;
            }

        }
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:45,代码来源:Transmission.java

示例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); 
}
 
开发者ID:team3882,项目名称:2017-Robot,代码行数:11,代码来源:Robot.java

示例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:
	}
}
 
开发者ID:TeamAutomatons,项目名称:Steamwork_2017,代码行数:30,代码来源:Robot.java

示例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);
	}
}
 
开发者ID:TeamAutomatons,项目名称:Steamwork_2017,代码行数:9,代码来源:Robot.java

示例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;
    }
}
 
开发者ID:cyborgs3335,项目名称:STEAMworks,代码行数:11,代码来源:Dumper.java

示例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);
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:9,代码来源:AManipulators.java

示例11: toggleIntakeSolenoid

import edu.wpi.first.wpilibj.DoubleSolenoid.Value; //导入依赖的package包/类
public void toggleIntakeSolenoid() {
	Value SolenoidVal = Actuator.get();
	if (SolenoidVal == Value.kForward) {
		lowerRake();
	} else {
		raiseRake();

	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:10,代码来源:Intake.java

示例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);
	}
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:9,代码来源:BallDoor.java

示例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);
	}
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:11,代码来源:BallDoor.java

示例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;
	}
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:16,代码来源:GearManipulator.java

示例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);
	}
}
 
开发者ID:FIRST-Team-1699,项目名称:2017-code,代码行数:11,代码来源:GearManipulator.java


注:本文中的edu.wpi.first.wpilibj.DoubleSolenoid.Value类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。