//Force Sensor to Light Fade
//turn on the serial statements to DEBUG
//add in mapping statements to make for a better response
int ForceSensePin1 = A0;
int ForceSensePin2 = A1;
int ForceSensePin3 = A2;
int ForceSensePin4 = A3;
int ForceSensePin5 = A4;
int ForceSensePin6 = A5;
int wait = 10;
int i;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
for(i=0; i<7; i++) {
int ForceSensorValue(i) = analogRead(ForceSensePin(i));
float voltage = ForceSensorValue(i) * (5.0 / 1023.0);
ForceSensorValue(i) = map(ForceSensorValue(i), 100, 1023, 0, 255);
ForceSensorValue(i) = constrain(ForceSensorValue(i), 0, 255);
Serial.print(“ForceSensorPin “);
Serial.print(i);
Serial.print(” = “);
Serial.print(voltage);
Serial.println(“”);
delay(wait);
}
// float voltage = sensorValue * (5.0 / 1023.0);
//ForceSensorValue = map(ForceSensorValue, 100, 1023, 0, 255);
// in case the sensor value is outside the range seen during calibration
// ForceSensorValue = constrain(ForceSensorValue, 0, 255);
// put your main code here, to run repeatedly:
}