本文整理匯總了Java中com.pi4j.io.gpio.RaspiPin.GPIO_05屬性的典型用法代碼示例。如果您正苦於以下問題:Java RaspiPin.GPIO_05屬性的具體用法?Java RaspiPin.GPIO_05怎麽用?Java RaspiPin.GPIO_05使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.pi4j.io.gpio.RaspiPin
的用法示例。
在下文中一共展示了RaspiPin.GPIO_05屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPinForNumber
private Pin getPinForNumber(int number) {
switch (number) {
case 0:
return RaspiPin.GPIO_00;
case 1:
return RaspiPin.GPIO_01;
case 2:
return RaspiPin.GPIO_02;
case 3:
return RaspiPin.GPIO_03;
case 4:
return RaspiPin.GPIO_04;
case 5:
return RaspiPin.GPIO_05;
case 6:
return RaspiPin.GPIO_06;
case 7:
return RaspiPin.GPIO_07;
case 8:
return RaspiPin.GPIO_08;
case 9:
return RaspiPin.GPIO_09;
case 10:
return RaspiPin.GPIO_10;
case 11:
return RaspiPin.GPIO_11;
case 12:
return RaspiPin.GPIO_12;
case 13:
return RaspiPin.GPIO_13;
case 14:
return RaspiPin.GPIO_14;
case 15:
return RaspiPin.GPIO_15;
case 16:
return RaspiPin.GPIO_16;
case 17:
return RaspiPin.GPIO_17;
case 18:
return RaspiPin.GPIO_18;
case 19:
return RaspiPin.GPIO_19;
case 20:
return RaspiPin.GPIO_20;
}
return null;
}
示例2: getPin
/**
* Get a GPIO pin from an integer
*
* @param theStatusPin integer representation of the pin
* @return
*/
public static Pin getPin(int theStatusPin)
{
Pin aPin = RaspiPin.GPIO_02;
switch (theStatusPin)
{
case 0:
aPin = RaspiPin.GPIO_00;
break;
case 1:
aPin = RaspiPin.GPIO_01;
break;
case 2:
aPin = RaspiPin.GPIO_02;
break;
case 3:
aPin = RaspiPin.GPIO_03;
break;
case 4:
aPin = RaspiPin.GPIO_04;
break;
case 5:
aPin = RaspiPin.GPIO_05;
break;
case 6:
aPin = RaspiPin.GPIO_06;
break;
case 7:
aPin = RaspiPin.GPIO_07;
break;
case 8:
aPin = RaspiPin.GPIO_08;
break;
case 9:
aPin = RaspiPin.GPIO_09;
break;
case 10:
aPin = RaspiPin.GPIO_10;
break;
case 11:
aPin = RaspiPin.GPIO_11;
break;
case 12:
aPin = RaspiPin.GPIO_12;
break;
case 13:
aPin = RaspiPin.GPIO_13;
break;
case 14:
aPin = RaspiPin.GPIO_14;
break;
case 15:
aPin = RaspiPin.GPIO_15;
break;
case 16:
aPin = RaspiPin.GPIO_16;
break;
case 17:
aPin = RaspiPin.GPIO_17;
break;
case 18:
aPin = RaspiPin.GPIO_18;
break;
case 19:
aPin = RaspiPin.GPIO_19;
break;
case 20:
aPin = RaspiPin.GPIO_20;
break;
}
return aPin;
}
示例3: getPinInstance
Pin getPinInstance(){
Pin result = null;
switch(config.getPinNumber().intValue()){
case 0:
result = RaspiPin.GPIO_00;
break;
case 1:
result = RaspiPin.GPIO_01;
break;
case 2:
result = RaspiPin.GPIO_02;
break;
case 3:
result = RaspiPin.GPIO_03;
break;
case 4:
result = RaspiPin.GPIO_04;
break;
case 5:
result = RaspiPin.GPIO_05;
break;
case 6:
result = RaspiPin.GPIO_06;
break;
case 7:
result = RaspiPin.GPIO_07;
break;
case 8:
result = RaspiPin.GPIO_08;
break;
case 9:
result = RaspiPin.GPIO_09;
break;
case 10:
result = RaspiPin.GPIO_10;
break;
case 11:
result = RaspiPin.GPIO_11;
break;
case 12:
result = RaspiPin.GPIO_12;
break;
case 13:
result = RaspiPin.GPIO_13;
break;
case 14:
result = RaspiPin.GPIO_14;
break;
case 15:
result = RaspiPin.GPIO_15;
break;
case 16:
result = RaspiPin.GPIO_16;
break;
case 17:
result = RaspiPin.GPIO_17;
break;
case 18:
result = RaspiPin.GPIO_18;
break;
case 19:
result = RaspiPin.GPIO_19;
break;
case 20:
result = RaspiPin.GPIO_20;
break;
}
return result;
}
示例4: getPinoMapeado
private Pin getPinoMapeado(Integer endereco) {
switch(endereco.intValue()){
case 0:
return RaspiPin.GPIO_00;
case 1:
return RaspiPin.GPIO_01;
case 2:
return RaspiPin.GPIO_02;
case 3:
return RaspiPin.GPIO_03;
case 4:
return RaspiPin.GPIO_04;
case 5:
return RaspiPin.GPIO_05;
case 6:
return RaspiPin.GPIO_06;
case 7:
return RaspiPin.GPIO_07;
case 8:
return RaspiPin.GPIO_08;
case 9:
return RaspiPin.GPIO_09;
case 10:
return RaspiPin.GPIO_10;
case 11:
return RaspiPin.GPIO_11;
case 12:
return RaspiPin.GPIO_12;
case 13:
return RaspiPin.GPIO_13;
case 14:
return RaspiPin.GPIO_14;
case 15:
return RaspiPin.GPIO_15;
case 16:
return RaspiPin.GPIO_16;
case 17:
return RaspiPin.GPIO_17;
case 18:
return RaspiPin.GPIO_18;
case 19:
return RaspiPin.GPIO_19;
case 20:
return RaspiPin.GPIO_20;
default:
throw new IllegalArgumentException("endereco inexistente.");
}
}
示例5: getGpioPinFor
/**
* Get GPIO pin number for a specific wire.
*
* @param param
* Param name
* @param defaultPin
* Default pin if not found in file
* @return Raspi pin of this param
*/
public Pin getGpioPinFor(String param, Pin defaultPin) {
Pin pin = defaultPin;
int pinNumber = getIntProperties(param, -1);
if (pinNumber != -1) {
switch (pinNumber) {
case 0:
pin = RaspiPin.GPIO_00;
break;
case 1:
pin = RaspiPin.GPIO_01;
break;
case 2:
pin = RaspiPin.GPIO_02;
break;
case 3:
pin = RaspiPin.GPIO_03;
break;
case 4:
pin = RaspiPin.GPIO_04;
break;
case 5:
pin = RaspiPin.GPIO_05;
break;
case 6:
pin = RaspiPin.GPIO_06;
break;
case 7:
pin = RaspiPin.GPIO_07;
break;
case 8:
pin = RaspiPin.GPIO_08;
break;
case 9:
pin = RaspiPin.GPIO_09;
break;
case 10:
pin = RaspiPin.GPIO_10;
break;
case 11:
pin = RaspiPin.GPIO_11;
break;
case 12:
pin = RaspiPin.GPIO_12;
break;
case 13:
pin = RaspiPin.GPIO_13;
break;
case 14:
pin = RaspiPin.GPIO_14;
break;
case 15:
pin = RaspiPin.GPIO_15;
break;
case 16:
pin = RaspiPin.GPIO_16;
break;
case 17:
pin = RaspiPin.GPIO_17;
break;
case 18:
pin = RaspiPin.GPIO_18;
break;
case 19:
pin = RaspiPin.GPIO_19;
break;
case 20:
pin = RaspiPin.GPIO_20;
break;
}
}
return pin;
}
示例6: blinkAll
public static void blinkAll()throws InterruptedException{
final GpioController gpio = GpioFactory.getInstance();
final GpioPinDigitalOutput led1 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01);
final GpioPinDigitalOutput led2 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02);
final GpioPinDigitalOutput led3 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03);
final GpioPinDigitalOutput led4 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_04);
final GpioPinDigitalOutput led5 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_05);
final GpioPinDigitalOutput led6 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_06);
final GpioPinDigitalOutput led7 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_07);
final GpioPinDigitalOutput led8 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_08);
final GpioPinDigitalOutput led9 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_09);
final GpioPinDigitalOutput led10 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_10);
final GpioPinDigitalOutput led11 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_11);
final GpioPinDigitalOutput led12 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_12);
final GpioPinDigitalOutput led13 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_13);
final GpioPinDigitalOutput led14 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_14);
final GpioPinDigitalOutput led15 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_15);
final GpioPinDigitalOutput led16 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_16);
final GpioPinDigitalOutput led17 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_17);
final GpioPinDigitalOutput led18 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_18);
final GpioPinDigitalOutput led19 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_19);
final GpioPinDigitalOutput led20 = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_20);
GpioPin p = (GpioPin) RaspiPin.GPIO_05;
gpio.setPullResistance(PinPullResistance.PULL_DOWN, p);
led1.blink(500);
led2.blink(500);
led3.blink(500);
led4.blink(500);
led5.blink(500);
led6.blink(500);
led7.blink(500);
led8.blink(500);
led9.blink(500);
led10.blink(500);
led11.blink(500);
led12.blink(500);
led13.blink(500);
led14.blink(500);
led15.blink(500);
led16.blink(500);
led17.blink(500);
led18.blink(500);
led19.blink(500);
led20.blink(500);
System.out.println("sleeping");
Thread.sleep(2000);
}