Digital Inputs

From Biemme Italia Wiki
Jump to: navigation, search

Digital Inputs

Pltouch Digital Inputs
Specifications Description
Input signal voltage DC24V±10%
Input signal current 7mA / DC24V
Input OFF current Less than 1mA
Circuit insulation Fully isolated optocoupler

The figure on the right contains the pin numbering of clamp X2.


In order to read the status of the digital inputs, just use the pManager.digitalRead(n) function providing a pin number. The function will return 1 (or the constant HIGH) when the input is high, zero otherwise (or LOW respectively). n: is numbers of digital inputs pin ( 1 to 12 ) The example that follows based on the value of the first digital input pin, a TextView widget will be modified.

@Override
public void onLogicExecution() {
	Log.d("Pltouch", "on logic execution");
 
	runOnUiThread(new Runnable() {
 
		@Override
		public void run() {
			try {
				if (pManager.digitalRead(1) == DigitalValues.HIGH){
					analog1.setText("Digital Input 1 HIGH");
				}else{
					analog1.setText("");
				}
			} catch (IndexOutOfBounds e) {
				e.printStackTrace();
			}
		}
	});
}
Personal tools
Namespaces

Variants
Actions
Structure
Store