sparkfun Qwiic Flex Glove Controller SEN-14666 Hook-Up Manual page 11

Table of Contents

Advertisement

#include <SparkFun_ADS1015_Arduino_Library.h>
ADS1015 fingerSensor;
void setup() {
Wire.begin();
Serial.begin(115200);
if (fingerSensor.begin(Wire, 100000, ADS1015_ADDRESS_GND) == false) {
Serial.println("Device not found. Check wiring.");
while (1);
}
}
void loop() {
uint16_t data;
for (int finger = 0; finger < 2; finger++) {
data = fingerSensor.getAnalogData(finger);
Serial.print(finger);
Serial.print(": ");
Serial.print(data);
Serial.print(",");
}
Serial.println();
}
Uploading this sketch and opening the Serial Monitor to 115200 bps will yield an output somewhat like the below
image.
Example 2 - Setup hand
In this example, we'll see how to setup an entire hand of flex sensors. To get started with this example, open up
File > Examples > SparkFun ADS1015 Arduino Library > Example2_SetupHand. In this example, we create
two
objects, naming them
ADS1015
glove. We also create an array with 4 spots to hold the data for the hand called
with values from each sensor. The code that accomplishes this is shown below.
Single Sensor Output - click the image for a closer look
and
indexSensor
to correspond with their locations on the
pinkySensor
. We then populate
hand
hand

Advertisement

Table of Contents
loading
Need help?

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

Subscribe to Our Youtube Channel

Table of Contents