<< cmd_dcmotor_setup Arduino toolbox cmd_digital_out >>

Arduino toolbox >> Arduino toolbox > cmd_digital_in

cmd_digital_in

Command to read in digital signal from a connected Arduino board

Calling Sequence

values = cmd_digital_in(h,pin_no)

Parameters

h :

Board number, reserved for future use. For this version, any number would do

pin_no :

Digital pin to measure the signal

Description

The Arduino board has a set of logical ports (digital) that are used for writing or reading data from a component.

To map a UNO, ports 2-13 are available (0 and 1 are used for serial transmission). For MEGA board, ports 2-53 are available. The port takes the low logic level (0) or logic high (1) which corresponds to the reference voltage.

Examples

ok = open_serial(1,9,115200)
val = cmd_digital_in(1,2)
close_serial(1)

See also

Authors


Report an issue
<< cmd_dcmotor_setup Arduino toolbox cmd_digital_out >>