Hello, I am a high school student working on a major design project. It is a starting block that will detect the force put into different parts of the footpads. However I have very little programming knowledge and need help with making code that will differentiate between each (A) pin that is used. Such as, Heel Force (R)... Forefoot Force (L). Below is my current arduino setup and the code. I am wishing to display these in the Serial Monitor and Plotter Thank you
This is my Code
const byte PinFsr [] = { A0, A1, A2, A3};
const unsigned Nfsr = sizeof(PinFsr);
char s [80];
const char *t;
// -----------------------------------------------------------------------------
void loop ()
{
for (unsigned n = 0; n < Nfsr; n++) {
int fsr = analogRead (PinFsr [n]);
if (fsr < 10)
t = "No pressure";
else if (fsr < 200)
t = "Light touch";
else if (fsr < 500)
t = "Light squeeze";
else if (fsr < 800)
t = "Medium squeeze";
else
t = "Big squeeze";
sprintf (s, " %6d %-18s", fsr, t);
Serial.print (s);
}
Serial.println ();
delay (100);
}
// -----------------------------------------------------------------------------
void setup ()
{
Serial.begin (9600);
}