How can I visualize five force-sensors at the same time?

In my project,
I examine the handshake between different people.
So I built a glove with five force-sensors to show the force.
Now my problem is, to visualize the force. I don't know weather
it's possible or not. So I've already programmed one sensor but not all five.
If somebody has a solution, can you please
send me the sketch. That would be nice.
Thank you for all the answers.

What do you mean by "visualize" the force?

I mean to visualize the force with the serial monitor.

The force is an energy field created by all living things, it surrounds us, it penetrates us, it binds the galaxy together.

Stretch out with your feelings.

What force sensors? Post a link to the data sheet.

What code did you use to report the output of one force sensor? Read "How to use this forum" and post the code correctly, using code tags.

Joeyey:
I mean to visualize the force with the serial monitor.

Use Serial.print. You might do well to print a tab between them so they line up. Print a carriage return after the last one so the next set is on a new line.

That's so stupid simple that I think I must be misunderstanding the question.

Here’s the link to the datasheet:

And my code:

``````const int FSR_PIN = A0; // Pin connected to FSR/resistor divider

// Measure the voltage at 5V and resistance of your 3.3k resistor, and enter
// their value's below:
const float VCC = 4.98; // Measured voltage of Ardunio 5V line
const float R_DIV = 3230.0; // Measured resistance of 3.3k resistor

void setup()
{
Serial.begin(9600);
pinMode(FSR_PIN, INPUT);
}

void loop()
{
// If the FSR has no pressure, the resistance will be
// near infinite. So the voltage should be near 0.
if (fsrADC != 0) // If the analog reading is non-zero
{
// Use ADC reading to calculate voltage:
float fsrV = fsrADC * VCC / 1023.0;
// Use voltage and static resistor value to
// calculate FSR resistance:
float fsrR = R_DIV * (VCC / fsrV - 1.0);
Serial.println("Resistance: " + String(fsrR) + " ohms");
// Guesstimate force based on slopes in figure 3 of
// FSR datasheet:
float force;
float fsrG = 1.0 / fsrR; // Calculate conductance
// Break parabolic curve down into two linear slopes:
if (fsrR <= 600)
force = (fsrG - 0.00075) / 0.00000032639;
else
force =  fsrG / 0.000000642857;
Serial.println("Force: " + String(force) + " g");
Serial.println();

delay(500);
}
else
{
// No pressure detected
}
}
``````

Thank you for the answer

Attach additional force sensors to the other analog pins and proceed similarly.

So I’ve programmed it with two force-sensors. But in my code there’s an error. Can someone show me, what I did wrong and how I can improve it? That would be nice.
Here’s my code:

``````const int FSR_PIN = A0;
const int FSR_PIN1 = A1; // Pin connected to FSR/resistor divider

// Measure the voltage at 5V and resistance of your 3.3k resistor, and enter
// their value's below:
const float VCC = 4.98; // Measured voltage of Ardunio 5V line
const float R_DIV = 3230.0; // Measured resistance of 3.3k resistor

void setup()
{
Serial.begin(9600);
pinMode(FSR_PIN, INPUT);
pinMode(FSR_PIN1, INPUT);
}

void loop()
{
// If the FSR has no pressure, the resistance will be
// near infinite. So the voltage should be near 0.
if((fsrADC != 0)  &&  (fsrADC1 != 0)); // If the analog reading is non-zero
{
// Use ADC reading to calculate voltage:
float fsrV = fsrADC * VCC / 1023.0;
float fsrV1 = fsrADC1 * VCC / 1023.0;
// Use voltage and static resistor value to
// calculate FSR resistance:
float fsrR = R_DIV * (VCC / fsrV - 1.0);
float fsrR1 = R_DIV * (VCC / fsrV1 - 1.0);
Serial.println("Resistance: " + String(fsrR) + " ohms");
Serial.println("Resistance: " + String(fsrR1) + " ohms");
// Guesstimate force based on slopes in figure 3 of
// FSR datasheet:
float force;
float force1;

float fsrG = 1.0 / fsrR;
float fsrG1 = 1.0 / fsrR1;

if ((fsrR <= 600)  &&  (fsrR1 <= 600));
force = (fsrG - 0.00075) / 0.00000032639;
force1 = (fsrG1 - 0.00075) / 0.00000032639;
else
force =  fsrG / 0.000000642857;
force1 =  fsrG1 / 0.000000642857;
Serial.println("Force: " + String(force) + " g");
Serial.println("Force: " + String(force1) + " g");
Serial.println();
Serial.println();

delay(500);
}
else
{
// No pressure detected
}
}
``````

Thank you for the answer.

Tell us about the "error".

Hint: read the "How to use this forum" post.

The error is: else without a previous if.

But this isn't true, because as you see there is a previous if.
But what is wrong?

Thank you for the answer.

You forgot the curly braces "{}".

It would be a good idea to brush up on the C/C++ programming languages. There are many very clear tutorials on line.

The Serial Plotter may also be an option. It's only arrived recently in the Arduino IDE and doesn't seem to have any documentation yet.

Output your values with commas separating them. The serial plotter will draw them as different-coloured lines.

``````Serial.print(force);
Serial.print(",");
Serial.print(force1);
Serial.print(",");
Serial.print(force2);
Serial.println();
``````