/** * Called when the robot first starts, (only once at power-up). */ public void robotInit() { //NetworkTable.setTeam(1259); adding the setTeam() method will cause the robot to encounter a thread error //NetworkTable.setIPAddress("10.12.59.2"); operatorInputs = new OperatorInputs(); drive = new DriveTrain(operatorInputs); prefs = Preferences.getInstance(); pickerPID = new PickerPID(); shoot = new Shooter(operatorInputs); pick = new Picker(operatorInputs, pickerPID, shoot); compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, COMPRESSOR_RELAY_CHANNEL); colwellContraption1 = new Solenoid(1, 3); colwellContraption2 = new Solenoid(1, 4); colwellContraption2.set(true); this.autoTimer = new Timer(); drive.leftEncoder.start(); drive.rightEncoder.start(); drive.timer.start(); autoTimer.start(); }
public DriveTrain(OperatorInputs _operatorInputs) { this.operatorInputs = _operatorInputs; this.leftTalons = new Talon(LEFT_PORT); this.rightTalons = new Talon(RIGHT_PORT); this.gearShiftLow = new Solenoid(SHIFT_MODULE, SHIFT_PORT_LOW); this.gearShiftHigh = new Solenoid(SHIFT_MODULE, SHIFT_PORT_HIGH); this.leftEncoder = new Encoder(3, 4); this.rightEncoder = new Encoder(5, 6); this.timer = new Timer(); //Start all wheels off leftTalons.set(0); rightTalons.set(0); //Starts in low gear gearShiftLow.set(isHighGear); gearShiftHigh.set(!isHighGear); leftEncoder.setDistancePerPulse(-DISTANCE_PER_PULSE); rightEncoder.setDistancePerPulse(DISTANCE_PER_PULSE); }
/** * */ public DriveTrain() { super("DriveTrain"); FLeftMotor = new Victor(RobotMap.FLeftMotorPWM); FRightMotor = new Victor(RobotMap.FRightMotorPWM); BLeftMotor = new Victor(RobotMap.BLeftMotorPWM); BRightMotor = new Victor(RobotMap.BRightMotorPWM); //MLeftMotor = new Victor(RobotMap.MLeftMotorPWM); //MRightMotor = new Victor(RobotMap.MRightMotorPWM); drive = new RobotDrive(FLeftMotor, BLeftMotor, FRightMotor, BRightMotor); //drive.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true); //drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true); GShiftSolDown = new Solenoid(RobotMap.DriveTrainLowGearSolenoid); GShiftSolUp = new Solenoid(RobotMap.DriveTrainHighGearSolenoid); display = DriverStationLCD.getInstance(); }
public PneumaticTest(int numDoubleValves) { super("PneumaticTestSubsystem"); try { m_solenoidExtend = new Solenoid[numDoubleValves]; m_solenoidRetract = new Solenoid[numDoubleValves]; m_position = new String[numDoubleValves]; int relayPort = 1; int moduleId = 1; for (int valveId = 0; valveId < numDoubleValves; valveId++) { if (valveId == 4) { moduleId = 2; relayPort = 1; } System.out.println("Pneumatic Extend, Valve id = " + valveId + ", module = " + moduleId + ", port = " + relayPort); m_solenoidExtend[valveId] = new Solenoid(moduleId, relayPort++); System.out.println("Pneumatic Retract, Valve id = " + valveId + ", module = " + moduleId + ", port = " + relayPort); m_solenoidRetract[valveId] = new Solenoid(moduleId, relayPort++); m_position[valveId] = PneumaticSubsystem.UNKNOWN; } } catch (Exception e) { System.out.println("Unknown error initializing " + getName() + ". Message = " + e.getMessage()); } }
public void update() { for (int cy = 0; cy < MODULES; cy++) { for (int cx = 0; cx < CHANNELS; cx++) { Solenoid s = solenoids[cy][cx]; if (s == null) { continue; } SmartDashboard.putBoolean(String.format("%d - %d", cy + 1, cx + 1), s.get()); } } }
public Drivetrain () { leftBackMotor = new TalonWrapper (RobotMap.Drivetrain.LEFT_BACK_MOTOR_CHANNEL, Constants.Drivetrain.LEFT_BACK_MOTOR_FLIPPED); leftMiddleMotor = new TalonWrapper (RobotMap.Drivetrain.LEFT_MIDDLE_MOTOR_CHANNEL, Constants.Drivetrain.LEFT_MIDDLE_MOTOR_FLIPPED); leftFrontMotor = new TalonWrapper (RobotMap.Drivetrain.LEFT_FRONT_MOTOR_CHANNEL, Constants.Drivetrain.LEFT_FRONT_MOTOR_FLIPPED); rightBackMotor = new TalonWrapper (RobotMap.Drivetrain.RIGHT_BACK_MOTOR_CHANNEL, Constants.Drivetrain.RIGHT_BACK_MOTOR_FLIPPED); rightMiddleMotor = new TalonWrapper (RobotMap.Drivetrain.RIGHT_MIDDLE_MOTOR_CHANNEL, Constants.Drivetrain.RIGHT_MIDDLE_MOTOR_FLIPPED); rightFrontMotor = new TalonWrapper (RobotMap.Drivetrain.RIGHT_FRONT_MOTOR_CHANNEL, Constants.Drivetrain.RIGHT_FRONT_MOTOR_FLIPPED); leftEnc = new EncoderWrapper (RobotMap.Drivetrain.LEFT_ENC_CHANNEL_A, RobotMap.Drivetrain.LEFT_ENC_CHANNEL_B); rightEnc = new EncoderWrapper (RobotMap.Drivetrain.RIGHT_ENC_CHANNEL_A, RobotMap.Drivetrain.RIGHT_ENC_CHANNEL_B); gyro = new Gyro(RobotMap.Drivetrain.GYRO_CHANNEL); shifter = new Solenoid(RobotMap.Drivetrain.SHIFTER_CHANNEL); leftTargetSpeed = rightTargetSpeed = leftCurrSpeed = rightCurrSpeed = 0; isBusy = false; isShifterLocked = false; }
public Loader() { Conveyor = new Victor(ReboundRumble.LOADER_CONVEYOR_PWM); loaderInSolenoid = new Solenoid(ReboundRumble.LOADER_IN_SOLENOID_CHANNEL); loaderOutSolenoid = new Solenoid(ReboundRumble.LOADER_OUT_SOLENOID_CHANNEL); loaderUpSolenoid = new Solenoid(ReboundRumble.LOADER_UP_SOLENOID_CHANNEL); loaderDownSolenoid = new Solenoid(ReboundRumble.LOADER_DOWN_SOLENOID_CHANNEL); loaderIn = new DigitalInput(ReboundRumble.LOAD_IN_GPIO_CHANNEL); loaderOut = new DigitalInput(ReboundRumble.LOAD_OUT_GPIO_CHANNEL); loaderUp = new DigitalInput(ReboundRumble.LOAD_UP_GPIO_CHANNEL); loaderDown = new DigitalInput(ReboundRumble.LOAD_DOWN_GPIO_CHANNEL); loaderDownSolenoid.set(false); loaderUpSolenoid.set(true); loaderOutSolenoid.set(false); loaderInSolenoid.set(true); }
public SystemShooter() { super(); wheel1 = new Victor(5); // Both bots: 5 wheel2 = new Victor(6); // Both bots: 6 cockOn = new Solenoid(4); //competition: 4 / practice: 1 cockOff = new Solenoid(3); //competition: 3 / practice: 2 fireOn = new Solenoid(6); // competition: 6 / practice: 5 fireOff = new Solenoid(5); // competition: 5 / practice 6 gateUp = new Solenoid(1); // competition: 1 / practice 3 gateDown = new Solenoid(2); // competition: 2 / practice 4 autoShoot = false; isShootingAngle = true; frisbeesShot = 0; enteringLoop = false; cockTime = WiredCats2415.textReader.getValue("cockTime"); gatesDownTime = WiredCats2415.textReader.getValue("gatesDownTime"); fireTime = WiredCats2415.textReader.getValue("fireTime"); System.out.println("[WiredCats] Initialized System Shooter"); }
public DriveTrain() { mjGauche = JoystickDevice.GetTankDriveGauche(); mjDroite = JoystickDevice.GetTankDriveDroite(); mDriveTrain = new RobotDrive(PwmDevice.mMoteurGaucheAvant, PwmDevice.mMoteurGaucheArriere, PwmDevice.mMoteurDroiteAvant, PwmDevice.mMoteurDroiteArriere); msTransmissionHi = new Solenoid(SolenoidDevice.mTransmissionHi); msTransmissionLow = new Solenoid(SolenoidDevice.mTransmissionLow); meTransmissionGauche = new Encoder(DigitalDevice.mTransmissionGaucheEncodeurA, DigitalDevice.mTransmissionGaucheEncodeurB); mfMoteurGauche = new FiltrePasseBas(25); meTransmissionDroite = new Encoder(DigitalDevice.mTransmissionDroiteEncodeurA, DigitalDevice.mTransmissionDroiteEncodeurB); mfMoteurDroite = new FiltrePasseBas(25); msTransmissionHi.set(false); msTransmissionLow.set(true); }
public void update() { for (int cy = 0; cy < modules; cy++) { for (int cx = 0; cx < channels; cx++) { Solenoid s = solenoids[cy][cx]; if (s == null) { continue; } labels[cy][cx].setText(String.format("%d - %d : %s", cy + 1, cx + 1, s.get())); } } solenoidWindow.invalidate(); solenoidWindow.validate(); }
public void reset() { for (int i = 0; i < motors.length; i++) { if (motors[i] == null) { continue; } if (motors[i] instanceof CANTalon) { ((CANTalon) motors[i]).delete(); } else if (motors[i] instanceof Victor) { ((Victor) motors[i]).free(); } } motors = new SpeedController[64]; for (int i = 0; i < solenoids.length; i++) { if (solenoids[i] == null) { continue; } solenoids[i].free(); } solenoids = new Solenoid[64]; for (int i = 0; i < relays.length; i++) { if (relays[i] == null) { continue; } relays[i].free(); } relays = new Relay[64]; for (int i = 0; i < analogInputs.length; i++) { if (analogInputs[i] == null) { continue; } analogInputs[i].free(); } analogInputs = new AnalogInput[64]; if (compressor != null) compressor.free(); }
public void robotInit() { frontLeft = new VictorSP(0); backLeft = new VictorSP(1); frontRight = new VictorSP(2); backRight = new VictorSP(3); intakeMotor = new VictorSP(4); compressor = new Compressor(0); intakeSolenoid = new Solenoid(0); driveTrain = new RobotDrive(frontLeft, backLeft, frontRight, backRight); driveTrain.setSafetyEnabled(false); driveTrain.setExpiration(0.1); driveTrain.setSensitivity(0.5); driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, false); driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearLeft, false); driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontRight, false); driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearRight, false); XboxController = new Joystick(2); rightJoystick = new Joystick(1); leftJoystick = new Joystick(0); }
/** * This function is run when the robot is first started up and should be * used for any initialization code. */ public void robotInit() { // PWM's mTestMotor1 = new Talon(0); mTestMotor2 = new Jaguar(1); mServo = new Servo(2); // Digital IO mDigitalOutput = new DigitalOutput(0); mRightEncoder = new Encoder(4, 5); mLeftEncoder = new Encoder(1, 2); mUltrasonic = new Ultrasonic(7, 6); // Analog IO mAnalogGryo = new AnalogGyro(0); mPotentiometer = new AnalogPotentiometer(1); // Solenoid mSolenoid = new Solenoid(0); // Relay mRelay = new Relay(0); // Joysticks mJoystick1 = new Joystick(0); mJoystick2 = new XboxController(1); // SPI mSpiGryo = new ADXRS450_Gyro(); // Utilities mTimer = new Timer(); mPDP = new PowerDistributionPanel(); Preferences.getInstance().putDouble("Motor One Speed", .5); }
public SnobotShooter(SpeedController aShooterMotor, Solenoid aShooterSolenoid, OperatorJoystick aShooterJoystick) { mShooterJoystick = aShooterJoystick; mShooterSolenoid = aShooterSolenoid; mShooterMotor = aShooterMotor; mIncreaseSpeedButton = new LatchedButton(); mDecreaseSpeedButton = new LatchedButton(); }
/** * This function is run when the robot is first started up and should be used for any initialization code. */ @Override public void robotInit() { // UI mShooterJoystick = new Joystick(PortMap.sOPERATOR_JOYSTICK_PORT); mDriveJoystick = new Joystick(PortMap.sDRIVER_JOYSTICK_PORT); mDriverController = new DriverJoystick(mDriveJoystick); mOperatorController = new OperatorJoystick(mShooterJoystick); //Shooter mShooterMotor = new Talon(PortMap.sSHOOTER_MOTOR); mShooterSolenoid = new Solenoid(PortMap.sSHOOTER_PISTON); mShooter = new SnobotShooter(mShooterMotor, mShooterSolenoid, mOperatorController); //Drive Train mLeftMotor = new Talon(PortMap.sLEFT_DRIVE_MOTOR); mRightMotor = new Talon(PortMap.sRIGHT_DRIVE_MOTOR); mDriveTrain = new SnobotDriveTrain(mLeftMotor, mRightMotor, mDriverController); // Intake mUpperIntakeMotor = new Talon(PortMap.sUPPER_INTAKE_MOTOR); mLowerIntakeMotor = new Talon(PortMap.sLOWER_INTAKE_MOTOR); mIntake = new SnobotIntake(mLowerIntakeMotor, mUpperIntakeMotor, mOperatorController); addModule(mDriveTrain); addModule(mShooter); addModule(mIntake); initializeLogHeaders(); // Now all the preferences should be loaded, make sure they are all // saved PropertyManager.saveIfUpdated(); }
public ClawArm() { System.out.println("Claw arm constructor method called"); armMotor = new TalonSRX(RobotMap.ClawArmMotor); clawPiston = new Solenoid(RobotMap.ClawPiston); armAngleSensor = new AnalogPotentiometer(RobotMap.ClawArmAngleSensor,270); bottomSwitch = new DigitalInput(RobotMap.ClawBottomSwitch); topSwitch = new DigitalInput(RobotMap.ClawTopSwitch); System.out.println("Claw arm constructor method complete."); }
public FrcPneumatic( final String instanceName, final int module, final int channel) { solenoids = new Solenoid[1]; solenoids[0] = new Solenoid(module, channel); initPneumatic(instanceName); }
public FrcPneumatic( final String instanceName, final int module, final int channel1, final int channel2) { solenoids = new Solenoid[2]; solenoids[0] = new Solenoid(module, channel1); solenoids[1] = new Solenoid(module, channel2); initPneumatic(instanceName); }
public FrcPneumatic( final String instanceName, final int module, final int channel1, final int channel2, final int channel3) { solenoids = new Solenoid[3]; solenoids[0] = new Solenoid(module, channel1); solenoids[1] = new Solenoid(module, channel2); solenoids[2] = new Solenoid(module, channel3); initPneumatic(instanceName); }
public FrcPneumatic( final String instanceName, final int module, int[] channels) { solenoids = new Solenoid[channels.length]; for (int i = 0; i < solenoids.length; i++) { solenoids[i] = new Solenoid(module, channels[i]); } initPneumatic(instanceName); }
public GearBoxSubsystem() { this.moveTop = new Solenoid(RobotMap.Solenoid.GEARBOX_SOLENOID3); this.releaseGear = new Solenoid(RobotMap.Solenoid.GEARBOX_SOLENOID1); this.pushGear = new Solenoid(RobotMap.Solenoid.GEARBOX_SOLENOID0); this.pushBox = new Solenoid(RobotMap.Solenoid.GEARBOX_SOLENOID2); }
public FrcPneumatic(final String instanceName, final int module, final int channel1, final int channel2) { solenoids = new Solenoid[2]; solenoids[0] = new Solenoid(module, channel1); solenoids[1] = new Solenoid(module, channel2); initPneumatic(instanceName); }
public FrcPneumatic(final String instanceName, final int module, int[] channels) { solenoids = new Solenoid[channels.length]; for (int i = 0; i < solenoids.length; i++) { solenoids[i] = new Solenoid(module, channels[i]); } initPneumatic(instanceName); }
/** * Constructor for this "BuiltinDefaultCode" Class. * * The constructor creates all of the objects used for the different inputs and outputs of * the robot. Essentially, the constructor defines the input/output mapping for the robot, * providing named objects for each of the robot interfaces. */ public DefaultRobot() { System.out.println("BuiltinDefaultCode Constructor Started\n"); // Create a robot using standard right/left robot drive on PWMS 1, 2, 3, and #4 m_robotDrive = new RobotDrive(1, 3, 2, 4); m_dsPacketsReceivedInCurrentSecond = 0; // Define joysticks being used at USB port #1 and USB port #2 on the Drivers Station m_rightStick = new Joystick(1); m_leftStick = new Joystick(2); // Iterate over all the buttons on each joystick, setting state to false for each int buttonNum = 1; // start counting buttons at button 1 for (buttonNum = 1; buttonNum <= NUM_JOYSTICK_BUTTONS; buttonNum++) { m_rightStickButtonState[buttonNum] = false; m_leftStickButtonState[buttonNum] = false; } // Iterate over all the solenoids on the robot, constructing each in turn int solenoidNum = 1; // start counting solenoids at solenoid 1 for (solenoidNum = 0; solenoidNum < NUM_SOLENOIDS; solenoidNum++) { m_solenoids[solenoidNum] = new Solenoid(solenoidNum + 1); } // Set drive mode to uninitialized m_driveMode = UNINITIALIZED_DRIVE; // Initialize counters to record the number of loops completed in autonomous and teleop modes m_autoPeriodicLoops = 0; m_disabledPeriodicLoops = 0; m_telePeriodicLoops = 0; System.out.println("BuiltinDefaultCode Constructor Completed\n"); }
/** * Display a given four-bit value in binary on the given solenoid LEDs */ void DisplayBinaryNumberOnSolenoidLEDs(int displayNumber, Solenoid[] solenoids) { if (displayNumber > 15) { // if the number to display is larger than can be displayed in 4 LEDs, display 0 instead displayNumber = 0; } solenoids[3].set( (displayNumber & 1) != 0); solenoids[2].set( (displayNumber & 2) != 0); solenoids[1].set( (displayNumber & 4) != 0); solenoids[0].set( (displayNumber & 8) != 0); }
public DriveSubsystem() { frontLeft = new Talon(RobotMap.DRIVE_FRONT_LEFT); frontRight = new Talon(RobotMap.DRIVE_FRONT_RIGHT); backLeft = new Talon(RobotMap.DRIVE_BACK_LEFT); backRight = new Talon(RobotMap.DRIVE_BACK_RIGHT); // driveTrain = new RobotDrive(frontLeft, backLeft, frontRight, backRight); trainSwitcher = new Solenoid(RobotMap.DRIVE_TRAIN_SWITCHER); // driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, REVERSE_FRONT_LEFT); // driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontRight, REVERSE_FRONT_RIGHT); // driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearLeft, REVERSE_BACK_LEFT); // driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearRight, REVERSE_BACK_RIGHT); // driveTrain.setSafetyEnabled(false); // driveTrain.setExpiration(2000); switchToMecanum(); }
public ShooterSubsystem() { winchSafety = new WinchSafetyThread(); initalizeCANJaguar(); firedLimit = new DigitalIOButton(RobotMap.SHOOTER_FIRED_LIMIT); canLimitBottom = new CANLimitButton(false); firedLimit.whenPressed(new LogToBlackBox("CAN Button hit top")); canLimitBottom.whenPressed(new LogToBlackBox("CAN Button hit bottom")); latch = new Solenoid(RobotMap.SHOOTER_LATCH); compressor = new Compressor(RobotMap.COMPRESSOR_SWITCH, RobotMap.COMPRESSOR_RELAY); compressor.start(); SmartDashboard.putNumber("P", P); SmartDashboard.putNumber("I", I); SmartDashboard.putNumber("D", D); }
public Winch() { super("Winch", kP, kI, kD, RobotMap.WINCH_DSC_PWM_ID, RobotMap.WINCH_ENCODER_A_DSC_DIO_ID, RobotMap.WINCH_ENCODER_B_DSC_DIO_ID, false, WINCH_DRUM_DIAMETER, WINCH_ENCODER_TO_DRUM_GEAR_RATIO); try { setFeedForwardInput(kF); m_drawLimitSwitch1 = new DigitalInput(RobotMap.WINCH_SWITCH_1_DSC_DIO_ID); m_drawLimitSwitch2 = new DigitalInput(RobotMap.WINCH_SWITCH_2_DSC_DIO_ID); m_drawZeroSwitch = new DigitalInput(RobotMap.DRAW_ZERO_SWITCH_DSC_DIO_ID); m_brakeSolenoidExtend = new Solenoid(RobotMap.BRAKE_EXTEND_PNEUMATIC_MODULE_ID, RobotMap.BRAKE_EXTEND_PNEUMATIC_RELAY_ID); m_brakeSolenoidRetract = new Solenoid(RobotMap.BRAKE_RETRACT_PNEUMATIC_MODULE_ID, RobotMap.BRAKE_RETRACT_PNEUMATIC_RELAY_ID); m_shiftSolenoidExtend = new Solenoid(RobotMap.WINCH_EXTEND_PNEUMATIC_MODULE_ID, RobotMap.WINCH_EXTEND_PNEUMATIC_RELAY_ID); m_shiftSolenoidRetract = new Solenoid(RobotMap.WINCH_RETRACT_PNEUMATIC_MODULE_ID, RobotMap.WINCH_RETRACT_PNEUMATIC_RELAY_ID); } catch (Exception e) { System.out.println("Unknown error initializing " + getName() + ". Message = " + e.getMessage()); } }
public PneumaticSubsystemSingleValve(String name, int extendModuleId, int extendRelayId) { super(name); try { m_solenoidExtend = new Solenoid(extendModuleId, extendRelayId); } catch (Exception e) { System.out.println("Unknown error initializing " + getName() + ". Message = " + e.getMessage()); } }
public PneumaticSubsystemDoubleValve(String name, int extendModuleId, int extendRelayId, int retractModuleId, int retractRelayId) { super(name); try { m_solenoidExtend = new Solenoid(extendModuleId, extendRelayId); m_solenoidRetract = new Solenoid(retractModuleId, retractRelayId); } catch (Exception e) { System.out.println("Unknown error initializing " + getName() + ". Message = " + e.getMessage()); } }
public Pivot() { super("Pivot", kP, kI, kD, RobotMap.PIVOT_DSC_PWM_ID, RobotMap.PIVOT_ENCODER_A_DSC_DIO_ID, RobotMap.PIVOT_ENCODER_B_DSC_DIO_ID, false, ENCODER_TO_YOKE_GEAR_RATIO); try { m_pivotLockSwitch = new DigitalInput(RobotMap.PIVOT_LOCK_SWITCH_DSC_DIO_ID); m_lockSolenoidExtend = new Solenoid(RobotMap.PIVOT_LOCK_EXTEND_PNEUMATIC_MODULE_ID, RobotMap.PIVOT_LOCK_EXTEND_PNEUMATIC_RELAY_ID); m_lockSolenoidRetract = new Solenoid(RobotMap.PIVOT_LOCK_RETRACT_PNEUMATIC_MODULE_ID, RobotMap.PIVOT_LOCK_RETRACT_PNEUMATIC_RELAY_ID); this.setDeviceMaxAllowablePositionError(MAX_ALLOWABLE_ANGLE_ERROR); this.setSoftLimits(PIVOT_POSITION_REVERSE_INTAKE, PIVOT_POSITION_FORWARD_INTAKE); this.setSoftLimitOn(true); } catch (Exception e) { System.out.println("Unknown error initializing " + getName() + ". Message = " + e.getMessage()); } }
public void init(Environment env) { inputMethod = env.getInput(); speedController = new MultiMotor(new SpeedController[]{new Jaguar(RobotMap.SHOOTER_MOTOR_1),new Jaguar(RobotMap.SHOOTER_MOTOR_2)}); speedController.set(0); solenoid = new Solenoid(RobotMap.SHOOTER_SOLENOID); }
public WsSolenoid(String name, int module, int channel1) { this.subject = new BooleanSubject(name); subject.setValue(false); solenoid = new Solenoid(module, channel1); solenoid.set(false); }
public void add(Solenoid s, int module, int channel) { if ((module > solenoids.length) || (module < 1)) { return; } if ((channel > solenoids[0].length) || (channel < 1)) { return; } solenoids[module - 1][channel - 1] = s; }
/** * Creates a piston with solenoids on the given ports * @param extendPort the port to which the solenoid to extend the piston is connected * @param retractPort the port to which the solenoid to retract the piston is connected */ public BTPiston(int extendPort, int retractPort) { left = new Solenoid(extendPort); right = new Solenoid(retractPort); healthName = "DEBUG: BTPiston: Extend: "+extendPort+" Retract: "+retractPort; pistonG = new BTStatGroup(healthName); extended = pistonG.newBoolStat(healthName, false, Constants.DEBUGMODE); }
public Auto(Throweraterenator thrower, DriveTrain dt, DriverStation ds, Solenoid light) { this.thrower = thrower; this.dt = dt; this.ds = ds; this.light = light; }
/** * Creates a new piston. * @param pistonModule The digital module the solenoids are in * @param solenoid1 The channel the first solenoid is in * @param solenoid2 The channel the second solenoid is in */ public Piston(int pistonModule, int solenoid1, int solenoid2) { this.solenoid1 = new Solenoid(pistonModule, solenoid1); this.solenoid2 = new Solenoid(pistonModule, solenoid2); inverted = false; }