The BeagleBone Black hardware has six analog input pins (
Each analog input pin has a 12-bit analog-to-digital converter (ADC)
that converts the analog input voltage to a digital voltage reading.
In addition to the six input pins, the BeagleBone Black hardware
has power rail and ground pins (
readVoltage measures the voltage
applied to an analog input pin relative to the ADC ground pin (
The ADC-driver built into the Linux® kernel returns the voltage
measurement converted to a double. The values range from
1.8 V (
Never connect a voltage greater than
Vacross the ADC pins. Voltages greater than
V can damage the board.
Always connect the negative (ground) side of a voltage
GND_ADC. The ADC measures positive voltages
only. A reversed connection can damage the board.