ads1x15
¶
CircuitPython base class driver for ADS1015/1115 ADCs.
Author(s): Carter Nelson
- class adafruit_ads1x15.ads1x15.ADS1x15(i2c: busio.I2C, gain: float = 1, data_rate: Optional[int] = None, mode: adafruit_ads1x15.ads1x15.Mode = 256, address: int = 72)[source]¶
Base functionality for ADS1x15 analog to digital converters.
- Parameters
- property data_rate¶
The data rate for ADC conversion in samples per second.
- property gain¶
The ADC gain.
- property gains¶
Possible gain settings.
- get_last_result(fast: bool = False) int [source]¶
Read the last conversion result when in continuous conversion mode. Will return a signed integer value. If fast is True, the register pointer is not updated as part of the read. This reduces I2C traffic and increases possible read rate.
- property mode¶
The ADC conversion mode.
- property rate_config¶
Rate configuration masks.
- property rates¶
Possible data rate settings.
ads1015
¶
CircuitPython driver for ADS1015 ADCs.
Author(s): Carter Nelson
- class adafruit_ads1x15.ads1015.ADS1015(i2c: busio.I2C, gain: float = 1, data_rate: Optional[int] = None, mode: adafruit_ads1x15.ads1x15.Mode = 256, address: int = 72)[source]¶
Class for the ADS1015 12 bit ADC.
- property bits¶
The ADC bit resolution.
- property rate_config¶
Rate configuration masks.
- property rates¶
Possible data rate settings.
- adafruit_ads1x15.ads1015.P0 = 0¶
Analog Pin 0
- adafruit_ads1x15.ads1015.P1 = 1¶
Analog Pin 1
- adafruit_ads1x15.ads1015.P2 = 2¶
Analog Pin 2
- adafruit_ads1x15.ads1015.P3 = 3¶
Analog Pin 3
ads1115
¶
CircuitPython driver for 1115 ADCs.
Author(s): Carter Nelson
- class adafruit_ads1x15.ads1115.ADS1115(i2c: busio.I2C, gain: float = 1, data_rate: Optional[int] = None, mode: adafruit_ads1x15.ads1x15.Mode = 256, address: int = 72)[source]¶
Class for the ADS1115 16 bit ADC.
- property bits¶
The ADC bit resolution.
- property rate_config¶
Rate configuration masks.
- property rates¶
Possible data rate settings.
- adafruit_ads1x15.ads1115.P0 = 0¶
Analog Pin 0
- adafruit_ads1x15.ads1115.P1 = 1¶
Analog Pin 1
- adafruit_ads1x15.ads1115.P2 = 2¶
Analog Pin 2
- adafruit_ads1x15.ads1115.P3 = 3¶
Analog Pin 3
analog_in
¶
AnalogIn for single-ended and differential ADC readings.
Author(s): Carter Nelson, adapted from MCP3xxx original by Brent Rubell
- class adafruit_ads1x15.analog_in.AnalogIn(ads: adafruit_ads1x15.ads1x15.ADS1x15, positive_pin: int, negative_pin: Optional[int] = None)[source]¶
AnalogIn Mock Implementation for ADC Reads.
- Parameters
- property value¶
Returns the value of an ADC pin as an integer.
- property voltage¶
Returns the voltage from the ADC pin as a floating point value.