- The "int sensorVal = 14;" designates pin 14 of my arduino to sensorVal. Is that right?
No. Variable sensorVal is set to 14, but you still need to do
pinMode(sensorVal, INPUT);
and
analog/digitalRead(sensorVal);
to set up the pin and read values from it.
Your method for getting the maximum value is flawed. max(v1,v2) returns the value that is largest. Why 400 in your code ?
You need to do something like
before the loop set a variable, maybe call it maxValue, to zero
start the while loop
read the sensor
constrain it if necessary
map it to a larger range
set maxValue to max(maxValue, sensorValue)
end of while loop
maxValue now holds the maximum value read from the sensor
Judging from the names of your variables I assume that there are left and right foot switches. Is that right ?