Okay, I'm not sure quite what you mean by that; is it a mechanical problem, or a programming problem?
As an update I'm posting the current code I'm using below:
const byte numberOfSensors = 10;
int ldr_pins[numberOfSensors] = {
A0, A1, A2, A3, A4, A5, A6, A7, A8, A9};
int now[numberOfSensors] = {
0,0,0,0,0,0,0,0,0,0};
int then[numberOfSensors] = {
1000,1000,1000,1000,1000,1000,1000,1000,1000,1000};
int counterPin = A10; //Sets Analog 10 to Counter
const int THRESH = 200; //Sets threshold value to 200
void setup(){
pinMode(counterPin, OUTPUT); //Sets Counter to OUTPUT
pinMode(13, OUTPUT); //Sets Pin 13 the LED to Output
Serial.begin(9600);
}
void loop(){
int flag = false;
for (int i = 0; i < numberOfSensors; i++) {
now[i] = analogRead(ldr_pins[i]);
Serial.print ("now [i] =");
Serial.println (now [i]); //debugging
if (now[i] > (then[i] + THRESH) ) {
flag = true;
}
then[i] = now[i];
}
if (flag) {
digitalWrite(counterPin, HIGH);
digitalWrite(13, HIGH);
Serial.println ("Someone sat on the bench."); // more debugging
}
else {
digitalWrite(counterPin, LOW);
digitalWrite(13, LOW);
}
}