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.
This uses the external Aref+ pin as the positive voltage reference. The negative voltage reference is internally connected to ground.
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.
This uses both the external Aref+ and Aref- pins for the positive and negative voltage references respectively.
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:
- No support for INTERNAL, INTERNAL1V1 or INTERNAL2V56 voltage reference sources
- Additional support for negative voltage reference sources (Vref-)
Set the analog reference to use the external Aref+ pin with ground as the negative reference: