本文整理匯總了Java中com.wildstangs.inputmanager.inputs.WsDigitalInput類的典型用法代碼示例。如果您正苦於以下問題:Java WsDigitalInput類的具體用法?Java WsDigitalInput怎麽用?Java WsDigitalInput使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WsDigitalInput類屬於com.wildstangs.inputmanager.inputs包,在下文中一共展示了WsDigitalInput類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: WsInputManager
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //導入依賴的package包/類
/**
* Constructor for the WsInputManager.
*
* Each new data element to be added to the facade must be added here and
* have keys added above.
*/
protected WsInputManager() {
//Add the facade data elements
BooleanConfigFileParameter outputsFor2012 = new BooleanConfigFileParameter(WsOutputManager.getInstance().getClass().getName(), "2012_Robot", false);
if (outputsFor2012.getValue()) {
sensorInputs.add(new DataElement(RIGHT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(11)));
sensorInputs.add(new DataElement(FUNNELATOR_LIMIT_SWITCH, new WsDigitalInput(7)));
} else {
sensorInputs.add(new DataElement(RIGHT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(7)));
sensorInputs.add(new DataElement(FUNNELATOR_LIMIT_SWITCH, new WsDigitalInput(9)));
}
oiInputs.add(new DataElement(DRIVER_JOYSTICK, new WsDriverJoystick()));
oiInputs.add(new DataElement(MANIPULATOR_JOYSTICK, new WsManipulatorJoystick()));
// oiInputs.add(new DataElement(ENTER_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(5)));
// oiInputs.add(new DataElement(EXIT_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(7)));
oiInputs.add(new DataElement(ENTER_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(3)));
oiInputs.add(new DataElement(EXIT_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(4)));
oiInputs.add(new DataElement(SHOOTER_WHEEL_SPEED_OVERRIDE, new WsDSDigitalInput(2)));
oiInputs.add(new DataElement(AUTO_PROGRAM_SELECTOR, new WsDSAnalogInput(1)));
oiInputs.add(new DataElement(LOCK_IN_SWITCH, new WsDSDigitalInput(1)));
oiInputs.add(new DataElement(START_POSITION_SELECTOR, new WsDSAnalogInput(2)));
sensorInputs.add(new DataElement(LEFT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(6)));
sensorInputs.add(new DataElement(HOPPER_DOWN_LIMIT_SWITCH, new WsDigitalInput(13)));
sensorInputs.add(new DataElement(HOPPER_UP_LIMIT_SWITCH, new WsDigitalInput(12)));
sensorInputs.add(new DataElement(ACCUMULATOR_UP_LIMIT_SWITCH, new WsDigitalInput(8)));
}
示例2: InputManager
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //導入依賴的package包/類
/**
* Constructor for the InputManager.
*
* Each new data element to be added to the facade must be added here and
* have keys added above.
*/
protected InputManager() {
//Add the facade data elements
sensorInputs.addToIndex(UNKNOWN_INDEX, new NoInput());
sensorInputs.addToIndex(PRESSURE_TRANSDUCER_INDEX, new WsAnalogInput(4));
sensorInputs.addToIndex(FRONT_ARM_POT_INDEX, new WsAnalogInput(2));
sensorInputs.addToIndex(BACK_ARM_POT_INDEX, new WsAnalogInput(3));
// sensorInputs.addToIndex(LEFT_ENCODER_A_INDEX, new WsDigitalInput(2));
// sensorInputs.addToIndex(LEFT_ENCODER_B_INDEX, new WsDigitalInput(3));
// sensorInputs.addToIndex(RIGHT_ENCODER_A_INDEX, new WsDigitalInput(4));
// sensorInputs.addToIndex(RIGHT_ENCODER_B_INDEX, new WsDigitalInput(5));
sensorInputs.addToIndex(TENSION_LIMIT_SWITCH_INDEX, new WsDigitalInput(6));
sensorInputs.addToIndex(LATCH_POSITION_SWITCH_INDEX, new WsDigitalInput(8));
sensorInputs.addToIndex(CATAPULT_DOWN_SWITCH_INDEX, new WsDigitalInput(9));
sensorInputs.addToIndex(FRONT_ARM_CALIBRATION_SWITCH_INDEX, new WsDigitalInput(10));
sensorInputs.addToIndex(BACK_ARM_CALIBRATION_SWITCH_INDEX, new WsDigitalInput(11));
//Digital 7, 12, 13, and 14 are used for the LEDs
oiInputs.addToIndex(UNKNOWN_INDEX, new NoInput());
oiInputs.addToIndex(DRIVER_JOYSTICK_INDEX, new DriverJoystick());
oiInputs.addToIndex(MANIPULATOR_JOYSTICK_INDEX, new ManipulatorJoystick());
oiInputs.addToIndex(AUTO_PROGRAM_SELECTOR_INDEX, new WsDSAnalogInput(1));
oiInputs.addToIndex(LOCK_IN_SWITCH_INDEX, new WsDSDigitalInput(1));
oiInputs.addToIndex(START_POSITION_SELECTOR_INDEX, new WsDSAnalogInput(2));
oiInputs.addToIndex(ARM_FORCE_OVERRIDE_TO_MANUAL_SWITCH_INDEX, new WsDSDigitalInput(2));
}
示例3: update
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //導入依賴的package包/類
public void update() {
WsDigitalInput upSwitch = (WsDigitalInput) (WsInputManager.getInstance().getSensorInput(WsInputManager.ACCUMULATOR_UP_LIMIT_SWITCH));
boolean switchState = ((Boolean) (upSwitch.get((IInputEnum) null))).booleanValue();
SmartDashboard.putBoolean("Accumulator Up Limit Switch", switchState);
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_SOLENOID).set(null, Boolean.valueOf(solenoidState));
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_SECONDARY_SOLENOID).set(null, Boolean.valueOf(secondarySolenoidState));
if (motorForward == true && solenoidState == false && (false == ((WsHopper) WsSubsystemContainer.getInstance()
.getSubsystem(WsSubsystemContainer.WS_HOPPER)).isDownLimitSwitchTriggered())) {
motorForward = false;
}
if (motorForward) {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(maxVictorSpeed));
SmartDashboard.putNumber("Accumulator motor", maxVictorSpeed);
} else if (motorBack) {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(-maxVictorSpeed));
SmartDashboard.putNumber("Accumulator motor", -maxVictorSpeed);
} else {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(0.0));
SmartDashboard.putNumber("Accumulator motor", 0.0);
}
}