From 85c1c72db022bba891868afd3375e39dbe245701 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Wed, 20 Oct 2010 06:46:52 -0400 Subject: initial check-in of arduino docs in RST format (converted using wget+pandoc) --- source/arduino/analogreference.rst | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 source/arduino/analogreference.rst (limited to 'source/arduino/analogreference.rst') diff --git a/source/arduino/analogreference.rst b/source/arduino/analogreference.rst new file mode 100644 index 0000000..9a25169 --- /dev/null +++ b/source/arduino/analogreference.rst @@ -0,0 +1,66 @@ +.. _arduino-analogreference: + +analogReference(type) +===================== + +Description +----------- + +Configures the reference voltage used for analog input (i.e. the +value used as the top of the input range). The options are: + + + + +- DEFAULT: the default analog reference of 5 volts (on 5V Arduino + boards) or 3.3 volts (on 3.3V Arduino boards) +- INTERNAL: an built-in reference, equal to 1.1 volts on the + ATmega168 or ATmega328 and 2.56 volts on the ATmega8. +- EXTERNAL: the voltage applied to the AREF pin is used as the + reference. + + + +Parameters +---------- + +type: which type of reference to use (DEFAULT, INTERNAL, or +EXTERNAL). + + + +Returns +------- + +None. + + + +Warning +------- + +**If you're using an external reference voltage (applied to the AREF pin), you must set the analog reference to EXTERNAL before calling analogRead().** +Otherwise, you will short together the active reference voltage +(internally generated) and the AREF pin, possibly damaging the +microcontroller on your Arduino board. + + + +Alternatively, you can connect the external reference voltage to +the AREF pin through a 5K resistor, allowing you to switch between +external and internal reference voltages. Note that the resistor +will alter the voltage that gets used as the reference because +there is an internal 32K resistor on the AREF pin. The two act as a +voltage divider, so, for example, 2.5V applied through the resistor +will yield 2.5 \* 32 / (32 + 5) = ~2.2V at the AREF pin. + + + +See also +-------- + + +- `Description of the analog input pins `_ +- `analogRead `_\ () + + -- cgit v1.2.3