Hello, I have a flex sensor glove made from this website. When I run this code:
#include <SparkFun_ADS1015_Arduino_Library.h>
ADS1015 pinkySensor;
ADS1015 indexSensor;
uint16_t hand[4] = {0, 0, 0, 0};
void setup() {
Wire.begin();
Serial.begin(115200);
//Set up each sensor, change the addresses based on the location of each sensor
if (pinkySensor.begin() == false) {
Serial.println("Pinky not found. Check wiring.");
while (1);
}
if (indexSensor.begin() == false) {
Serial.println("Index not found. Check wiring.");
while (1);
}
pinkySensor.setGain(ADS1015_CONFIG_PGA_TWOTHIRDS); // Gain of 2/3 to works well with flex glove board voltage swings (default is gain of 2)
indexSensor.setGain(ADS1015_CONFIG_PGA_TWOTHIRDS); // Gain of 2/3 to works well with flex glove board voltage swings (default is gain of 2)
}
void loop() {
uint16_t data;
//Read and print our data
for (int finger = 0; finger < 2; finger++) {
hand[finger] = indexSensor.getAnalogData(finger);
hand[finger + 2] = pinkySensor.getAnalogData(finger);
}
for (int finger = 0; finger < 4; finger++)
{
Serial.print(finger);
Serial.print(": ");
Serial.print(hand[finger]);
Serial.print(" ");
}
Serial.println();
}
and plug only one of the flex sensor boards in, it works fine, with input 0 and 1 being repeated on input 2 and 3. However, when I plug in another flex sensor board into any of the I2C ports on the qwicc connect shield it makes the inputs merge I think. For example, if input 0 is 905 and input 1 is 918 when only one flex sensor board is plugged in, when I plug in the other flex sensor board and flex it, input 0 and 1 change to 10 and 8(and repeat on input 2 and 3). When I flex the first flex sensor board I plugged in the inputs change back to around 905 and 918. Any ideas on how I can separate the four inputs, or if it's an entirely different issue?
Thanks in advance,
Jai