I have attached an image showing how the first FSR is connected. I have replicated this three times, to attach the other two to the breadboard.
I tried a long-winded way of writing the code out three times.
I will try the altered code and add the arrays in.
Thank you.
Thank you for the code alterations. It wasn't working because I am using an ESP32 board and needed to change the output pins.
I have attached the code, and the corresponding serial output.
const float calibrationFactor = 19.5; // calibration factor
const byte flexiForceSensorPins[] = {A0, A3, A6}; // FlexiForce sensors are connected to 3 analog pins of arduino or mega.
void setup() {
Serial.begin(9600);
}
void loop() {
for (auto &ff : flexiForceSensorPins) {
float vout = (analogRead(ff) * 5.0) / 1023.0;
Serial.print(vout * calibrationFactor, 3); Serial.write('\t');
}
Serial.println();
delay(100);
}
Sounds like there may be a wiring problem. Double-check that everything is wired to the right pins. Try swapping pins between two FSR's to see if the problem moves (FSR problem) or stays the same (pin problem).
I agree that its wiring, but I'm unsure of how to change this. I've attached a photo of how this is currently held together on my breadboard. It uses the concept above where a potentiometer is used to customise the sensitivity. Thanks
I swapped around sensors, and wire connections and had the same issues. Where the first FSR displays and output for 1 and 2.
And pressing the 2nd always gives a maxed out value
Look at your solderless breadboard. Look at the red and blue lines down the power busses. See the gaps in the red and blue lines? That is a gap in the power busses. You need jumpers across that gap if you want to have power on both ends of the breadboard.