|Github Repo||C Header||C source||JS source|
Tested and works on esp8266/esp32
Analog-to-digital converter or higher-precision ADC.
| | precision | samples\sec | | :--- | :---: | :--- | | ADS1015 | 12-bit | 3300 | | ADS1115 | 16-bit | 860 |
The chip can be configured as 4 single-ended input channels, or two differential channels. As a nice bonus, it even includes a programmable gain amplifier, up to x16, to help boost up smaller single/differential signals to the full range. See ADS1015 ADS1115 for more information about the hardware.
config_schema: - ["i2c.enable", true] libs: - origin: https://github.com/mongoose-os-libs/arduino-adafruit-ads1x15
Create an ADS1015 instance: an object with the methods described below.
i2cAddress is an I2C address of the ADS1015.
Create an ADS1115 instance: an object with the methods described below.
i2cAddress is an I2C address of the ADS1115.
Close an instance; no methods can be called on this instance after that. Return value: none.
Set up the ADS1015/ADS1115 hardware
Get a single-ended ADC reading from the given
Read the conversion results, measuring the difference between the P (AIN0) and N (AIN1) input. Returns a signed value since the difference can be either positive or negative.
Read the conversion results, measuring the difference between the P (AIN2) and N (AIN3) input. Returns a signed value since the difference can be either positive or negative.
Set up the comparator to operate in basic mode, causing the ALERT/RDY
pin to assert (go from high to low) when the ADC value exceeds the
Return value: none.
In order to clear the comparator, we need to read the conversion results. This function reads the last conversion results without changing the config value.
Set the gain and input voltage range; one of the following:
Return value: none.edit this doc