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


Java RaspiPin.GPIO_11屬性代碼示例

本文整理匯總了Java中com.pi4j.io.gpio.RaspiPin.GPIO_11屬性的典型用法代碼示例。如果您正苦於以下問題:Java RaspiPin.GPIO_11屬性的具體用法?Java RaspiPin.GPIO_11怎麽用?Java RaspiPin.GPIO_11使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.pi4j.io.gpio.RaspiPin的用法示例。


在下文中一共展示了RaspiPin.GPIO_11屬性的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: main

public static void main(String args[]) throws InterruptedException {
	System.out.println("GPIO 4 bit LCD example program");
	final GpioController gpio = GpioFactory.getInstance();
	// initialize LCD
	final GpioLcdDisplay lcd = new GpioLcdDisplay(LCD_ROWS, // number of row
															// supported by
															// LCD
			LCD_COLUMNS, // number of columns supported by LCD
			RaspiPin.GPIO_11, // LCD RS pin
			RaspiPin.GPIO_10, // LCD strobe pin
			RaspiPin.GPIO_00, // LCD data bit 1
			RaspiPin.GPIO_01, // LCD data bit 2
			RaspiPin.GPIO_02, // LCD data bit 3
			RaspiPin.GPIO_03); // LCD data bit 4
	// clear LCD
	lcd.clear();
	Thread.sleep(1000);
	// write line 1 to LCD
	lcd.write(LCD_ROW_1, "- RPi LCD Java -");
	// write line 2 to LCD
	lcd.write(LCD_ROW_2, "github/iscalik");
	Thread.sleep(3000);
	// line data replacement
	for (int index = 0; index < 5; index++) {
		lcd.write(LCD_ROW_2, "----------------");
		Thread.sleep(500);
		lcd.write(LCD_ROW_2, "****************");
		Thread.sleep(500);
	}
	lcd.write(LCD_ROW_2, "----------------");
	// single character data replacement
	for (int index = 0; index < lcd.getColumnCount(); index++) {
		lcd.write(LCD_ROW_2, index, ">");
		if (index > 0)
			lcd.write(LCD_ROW_2, index - 1, "-");
		Thread.sleep(300);
	}
	for (int index = lcd.getColumnCount() - 1; index >= 0; index--) {
		lcd.write(LCD_ROW_2, index, "<");
		if (index < lcd.getColumnCount() - 1)
			lcd.write(LCD_ROW_2, index + 1, "-");
		Thread.sleep(300);
	}
	// left alignment, full line data
	lcd.write(LCD_ROW_2, "----------------");
	Thread.sleep(500);
	lcd.writeln(LCD_ROW_2, "<< LEFT");
	Thread.sleep(1000);
	// right alignment, full line data
	lcd.write(LCD_ROW_2, "----------------");
	Thread.sleep(500);
	lcd.writeln(LCD_ROW_2, "RIGHT >>", LCDTextAlignment.ALIGN_RIGHT);
	Thread.sleep(1000);
	// center alignment, full line data
	lcd.write(LCD_ROW_2, "----------------");
	Thread.sleep(500);
	lcd.writeln(LCD_ROW_2, "<< CENTER >>", LCDTextAlignment.ALIGN_CENTER);
	Thread.sleep(1000);
	// mixed alignments, partial line data
	lcd.write(LCD_ROW_2, "----------------");
	Thread.sleep(500);
	lcd.write(LCD_ROW_2, "<L>", LCDTextAlignment.ALIGN_LEFT);
	lcd.write(LCD_ROW_2, "<R>", LCDTextAlignment.ALIGN_RIGHT);
	lcd.write(LCD_ROW_2, "CC", LCDTextAlignment.ALIGN_CENTER);
	Thread.sleep(1000);
	SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
	// update time
	while (true) {
		// write time to line 2 on LCD
		lcd.writeln(LCD_ROW_2, formatter.format(new Date()),
				LCDTextAlignment.ALIGN_CENTER);
		Thread.sleep(1000);
	}
}
 
開發者ID:iscalik,項目名稱:RPi_LCD_Java,代碼行數:74,代碼來源:lcd.java

示例6: 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


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