edu.wpi.first.wpilibj.DigitalInput Java Examples

The following examples show how to use edu.wpi.first.wpilibj.DigitalInput. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SubsystemMast.java    From PowerUp-2018 with GNU General Public License v3.0 6 votes vote down vote up
/** gives birth to the CANTalons */
  public SubsystemMast(){
  	/** Does it make sense to move the limit switch IDs to Constants? **/
  	//no because they could be moved due to various electrical reasons-nate
  	lowerPinionLimit = new DigitalInput(6);
      upperPinionLimit = new DigitalInput(7);
      lowerScrewLimit  = new DigitalInput(3);
      upperScrewLimit  = new DigitalInput(4);
  	
  	leftPinion = new TalonSRX(Constants.LEFT_PINION_MOTOR);
  	rightPinion = new TalonSRX(Constants.RIGHT_PINION_MOTOR);
  	screw = new TalonSRX(Constants.SCREW_MOTOR);
  		voltage(leftPinion);
  		voltage(rightPinion);
  		voltage(screw);
  		
override = false;
  }
 
Example #2
Source File: Hardware.java    From strongback-java with MIT License 2 votes vote down vote up
/**
 * Create a generic normally closed digital switch sensor on the specified digital channel.
 *
 * @param channel the channel the switch is connected to
 * @return a switch on the specified channel
 */
public static Switch normallyClosed(int channel) {
    DigitalInput input = new DigitalInput(channel);
    return () -> !input.get();
}
 
Example #3
Source File: Hardware.java    From strongback-java with MIT License 2 votes vote down vote up
/**
 * Create a generic normally open digital switch sensor on the specified digital channel.
 *
 * @param channel the channel the switch is connected to
 * @return a switch on the specified channel
 */
public static Switch normallyOpen(int channel) {
    DigitalInput input = new DigitalInput(channel);
    return input::get;
}