ADC
— A/D Converter input interface¶
This module enables reading analog input values from the analog to digital converter (ADC) on the Beaglebone processor.
Example:
import Adafruit_BBIO.ADC as ADC
ADC.setup()
# The read method returns normalized values from 0 to 1.0
value = ADC.read("P9_40")
# The read_raw returns non-normalized values from 0 to 4095
value = ADC.read_raw("P9_40")
-
Adafruit_BBIO.ADC.
setup_adc
()¶ Setup and start the ADC hardware.
-
Adafruit_BBIO.ADC.
setup_read
(channel)¶ Read the normalized analog value for the channel.
Parameters: channel (str) – GPIO channel to read the value from (e.g. “P8_16”). Returns: normalized value reading from 0.0 to 1.0 Return type: float
-
Adafruit_BBIO.ADC.
setup_read_raw
(channel)¶ Read the raw analog value for the channel.
Note: Kernels older than 4.1.x returned a raw value range based on the reference voltage of 1.8 V–– from 0 to 1800. Parameters: channel (str) – GPIO channel to read the value from (e.g. “P8_16”). Returns: raw value reading from 0 to 4095 (12 bits). Return type: float