本文整理汇总了Java中com.pi4j.io.gpio.PinPullResistance.OFF属性的典型用法代码示例。如果您正苦于以下问题:Java PinPullResistance.OFF属性的具体用法?Java PinPullResistance.OFF怎么用?Java PinPullResistance.OFF使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.pi4j.io.gpio.PinPullResistance
的用法示例。
在下文中一共展示了PinPullResistance.OFF属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPinDetectorResistor
public void setPinDetectorResistor(String pinDetectorResistor) {
if (pinDetectorResistor==null || pinDetectorResistor.trim().length()==0)
this.pinDetectorResistor = PinPullResistance.OFF;
else {
switch (pinDetectorResistor.trim().toUpperCase()) {
case "UP":
this.pinDetectorResistor = PinPullResistance.PULL_UP;
break;
case "DOWN":
this.pinDetectorResistor = PinPullResistance.PULL_DOWN;
break;
case "OFF":
this.pinDetectorResistor = PinPullResistance.OFF;
break;
default:
throw new UnsupportedOperationException("Unknown value for internal resistor used with IR detector pin: "+pinDetectorResistor);
}
}
}
示例2: GpioObservableSensor
@Inject
public GpioObservableSensor(Gpio gpio, GpioProvider provider, String name, Pin pin) {
this(gpio, provider, name, pin, PinPullResistance.OFF);
}