Analog Input Pins


evive has 10 analog input pins behind Magic Lid. The Atmega controllers used for evive contain a total of 16 channel analog-to-digital (A/D) converters. Out of these, only 10 analog inputs are available to the user. The converter has 10-bit resolution, returning integers from 0 to 1023. While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of General Purpose Input/Output (GPIO) pins (the same as digital pins 0 – 13).

            evive Analog Pins

The analog pins can be used identically to the digital pins, using the aliases A0 (for analog input 0), A1, etc. For example, the code would look like this to set analog pin 0 to an output, and to set it HIGH.


analogRead(pin) function reads the value from the specific analog pin. The output is an integer value between 0 and 1023 (Due to a 10 bit analog to digital converter), which is mapped between 0 and 5 volts input voltage. This yields a resolution between readings of 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.

It takes about 112 microseconds (0.000112 s) to read an analog input, so the maximum reading rate is about 9,000 times a second.

Note: If the analog input pin is not connected to anything, the value returned by analogRead() will fluctuate based on a number of factors (e.g. the values of the other analog inputs, how close your hand is to the board, etc.).