<< cmd_analog_in | Arduino toolbox | cmd_analog_out >>

Arduino toolbox >> Arduino toolbox > cmd_analog_in_volt

# cmd_analog_in_volt

Command to read in analog signal from a connected Arduino board

### Calling Sequence

    val = cmd_analog_in_volt(h,pin_no)

### Parameters

h :

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

pin_no :

  Analog pin to measure the signal

val :

  Reading in the input voltage from 0-5V

### Description

Arduino UNO board has 6 analog input ports (A0 to A5), the Arduino Mega board has 16 analog input ports (A0 to A15). The 10 bits channels convert the analog input from 0 to 5 volts, to a digital value between 0 and 1023. This function scale the reading to 0-5 so the user could get the measured voltage directly

### Examples

    ok = open_serial(1,9,115200)
    val = cmd_analog_in_volt(1,9)
    close_serial(1)

### See also

- cmd_analog_out

### Authors

- Bruno JOFRET, Tan C.L.

Report an issue
<< cmd_analog_in | Arduino toolbox | cmd_analog_out >>