void analogReference(uint8_t mode);
The analogReference() function allows you to specify different combinations of internal and external voltage references for use during analog-to-digital conversion using analogRead(). mode can be one of: EXTERNAL, EXTMINUS, EXTPLUSMINUS or DEFAULT.
EXTERNAL This uses the external Aref+ pin as the positive voltage reference. The negative voltage reference is internally connected to ground.
EXTMINUS This uses the external Aref- pin (may not be provided on the board) as the negative voltage reference. The positive voltage reference is internally connected to Vdd.
EXTPLUSMINUS This uses both the external Aref+ and Aref- pins for the positive and negative voltage references respectively.
DEFAULT This connects the positive voltage reference to Vdd and the negative voltage reference to Vss. This is, as the name implies, the default operating mode.
The analogReference() function conforms to the Arduino 1.6.x specification with the following exceptions:
Set the analog reference to use the external Aref+ pin with ground as the negative reference: