Lighting an LED when a HC-SR04 ultrasonic sensor is triggered

The array and a for loop was the sensible way to do this.

The problem was that you did not call Trigger() inside the for loop and when you did it once it only tests sensor number 5 which does not exist.