當前位置: 首頁>>代碼示例>>Java>>正文


Java RaspiPin.GPIO_05屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:MajorTom4711,項目名稱:ProfiSounder,代碼行數:48,代碼來源:RpiGPIOStateProvider.java

示例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;
}
 
開發者ID:bigboxer23,項目名稱:PiGarage,代碼行數:77,代碼來源:GPIOUtils.java

示例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;
}
 
開發者ID:lathil,項目名稱:Ptoceti,代碼行數:70,代碼來源:AbstractPin.java

示例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.");
	}
}
 
開發者ID:Gunisalvo,項目名稱:Grappa,代碼行數:48,代碼來源:RaspberryPi4J.java

示例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;
}
 
開發者ID:benoitm76,項目名稱:F1TelemetryOnRpi,代碼行數:81,代碼來源:F1TelemetryProperties.java

示例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);
}
 
開發者ID:cprasmu,項目名稱:RasCam-Server,代碼行數:54,代碼來源:TestGPIO.java


注:本文中的com.pi4j.io.gpio.RaspiPin.GPIO_05屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。