int analogRead(uint8_t pin);
The analogRead() function performs an Analog-to-Digital Conversion of a voltage on an analog input pin. The sampled voltage is converted to a numeric value at the native resolution of the ADC module of the main MCU. Typically that is a 10-bit resolution yielding a 0-1023 output value. The pin may be either the absolute I/O pin number of the analog pin, a logical analog pin number starting from 0 (only supported on some boards), or the symbolic name Ax where x is the number of the analog pin as depicted on the board.
The voltage represented as a numeric value at the resolution of the ADC module. For a 10-bit module that yields 1024 possible steps, where 0 represents 0V and 1023 represents the analog reference voltage (see: analogReference()).
The analogRead() function conforms to the Arduino 1.6.x specification.
int val = analogRead(2);