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.

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.

read(pin: microcontroller.Pin, is_differential: bool = False) int[source]

I2C Interface for ADS1x15-based ADCs reads.

params:
param pin

individual or differential pin.

param bool is_differential

single-ended or differential read.

class adafruit_ads1x15.ads1x15.Mode[source]

An enum-like class representing possible ADC operating modes.

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.

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.

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.

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.