Syntax
uint32_t analogRead(
    uint32_t ulPin
);
ContentsIndex
PreviousUpNext
analogRead
Example
Syntax
uint32_t analogRead(
    uint32_t ulPin
);
Description

Reads the value of an specified analog input pin. It will map input votages 0 to 5 volts into integer values 0 to 1023.

Parameters
Parameters 
Description 
uint32_t ulPin 
[IN] Analog input pin number to be read;A0,A1 or A2 
Returns

uint32_t:0 to 1023

Example
uint32_t analogPin = A0;
uint32_t readVal = 0;
void setup()
{
    Serial.begin(9600);
}
void loop()
{
    readVal = analogRead(analogPin);
    Serial.println(readVal);
}
File

wiring_analog.h

Group