Arduino Toolkit - @arduino/readDigitalPin


: value = readDigitalPin (obj, pin)

Read digital value from a digital I/O pin.

Inputs

ar - connected arduino object.

pin - string name of the pin to read.

Outputs

value - the logical value (0, 1, true false) of the current pin state.

Example

 
 a = arduino ();
 pinvalue = readDigitalPin (a, 'D5');
 
 

See also: arduino, writeDigitalPin.