Help with array!

You need to split things up as there are two main things

a) is the counter working
b) is the display working

a)
replace

lightSegments(numbers[count]);

with

Serial.println(count);

And check the results on the serial monitor. That will prove if the counter is working correctly.

b)
replace loop() with

void loop() {
    count++;
    if (count == 10) count = 0;
    delay(500);
    lightSegments(numbers[count]);
  }
}

Then there is the delay(500); is the sensor ever active for longer than 500mS? If so you will execute this code again as soon as the delay is finished.

Learn to break things down into their component parts and test each part, when they all work by themselves there's a good chance they will work together.


Rob