Unassigned 8-bit integer for device address. If not defined, the library will use the default I C address
stored in the I C library (0x48). Other available addresses are 0x49, 0x4A, 0x4B (set by a 4-way solder
jumper on the bottom side of the board).
Input: Wire
Wire port assignment. If not defined, the library will use the default Wire port. Note, this is only available
to change on boards that in fact have multiple Wire Ports (like the Teensy).
Output: Boolean
True- Connected to I C device on the default (or specified) address.
False- No device found or connected.
.isConnected()
Checks to see if a device over the I C bus is connected. Returns boolean true or false depending on if the slave
device has correctly ack'd to an I C request.
Output: Boolean
True- Device present on the default (or specified) address.
False- No device found or connected.
.setMode(uint16_t mode)
Set the read mode of the sensor (continuous or single-shot).
Input: Unassigned 16-bit integer
0 - Continuous.
1 - Single-shot.
.getMode()
Returns which read mode you are currently in: continuous (0) or single-shot (1).
Output: Unassigned 16-bit integer
0 - Continuous.
1 - Single-shot.
.setGain(uint16_t gain)
Sets the gain of the programmable gain amplifier (PGA) inside the ADS1015. Note, this gain amplifier is located
just before the ADC converter, so it greatly effects your readings and can cause your readings to "max out". Pass
in one of the following
Input: Unassigned 16-bit integer
ADS1015_CONFIG_PGA_TWOTHIRDS : ± 6.144V
ADS1015_CONFIG_PGA_1 : ± 4.096V
ADS1015_CONFIG_PGA_2 : ± 2.048V (default)
ADS1015_CONFIG_PGA_4 : ± 1.024V
ADS1015_CONFIG_PGA_8 : ± 0.512V
ADS1015_CONFIG_PGA_16 : ± 0.256V
.getGain()
Returns the gain of the programmable gain amplifier (PGA) inside the ADS1015. This returns a 16-bit hex value.
The values and their corresponding gains and voltage ranges are as follows.
Output: Unassigned 16-bit integer
0x0000 - gain:2/3, input range:± 6.144V
0X0200 - gain:1, input range: ± 4.096V
0X0400 - gain:2, input range: ± 2.048V
2
2
2
2
from the library to easily set the gain.
#define "variables"
2
Need help?
Do you have a question about the Qwiic 12-Bit ADC and is the answer not in the manual?
Questions and answers