resetCalibration()
void setGain(uint16_t gain);
uint16_t getGain();
their corresponding gains are listed below.
: ± 0.256V
0x0E00
: ± 6.144V
0X0000
: ± 4.096V
0X0200
: ± 2.048V
0X0400
: ± 1.024V
0X0600
: ± 0.512V
0X0800
: ± 0.256V
0X0A00
void setSampleRate(uint16_t sampleRate);
16-bit values to change to the corresponding sample rate.
: 128 Hz
0X0000
: 250 Hz
0X0020
: 490 Hz
0X0040
: 920 Hz
0X0060
: 1600 Hz
0X0080
: 2400 Hz
0X00A0
: 3300 Hz
0X00C0
uint16_t getSampleRate();
Example Code
Now that we know how our library works, let's go ahead and get started pulling values from our flex sensors.
Example 1 - Basic Readings
To get started with the first example, open up File > Examples > SparkFun ADS1015 Arduino Library >
Example1_BasicReadings. In this example, we begin by creating an
then initializing our sensor object in the
and reading each channel on the ADS1015. The code for this is shown below.
— Resets the calibration to 0.
— Pass in different values for different gains
— Get's the gain of the ADS1015. This will return 16-bit hex value. The values and
— Returns the sample rate according to the above list of sample rates.
loop. We then get the values from each finger by looping through
setup()
— Sets the sample rate for the ADS1015, pass in the below
ADS1015
object called
fingerSensor
and
Need help?
Do you have a question about the Qwiic Flex Glove Controller SEN-14666 and is the answer not in the manual?
Questions and answers