So as your setup function says:-
You are not initialising pin 10, the last value in your pins array.
Try
for (int i = 0; i < 10; i++) {
pinMode(PINS[i], OUTPUT);
}
So as your setup function says:-
You are not initialising pin 10, the last value in your pins array.
Try
for (int i = 0; i < 10; i++) {
pinMode(PINS[i], OUTPUT);
}