I want to use an array to control output values. What can I do?

I'm not sure I understand what you're talking about but maybe try making the pwmVals loops the outside ones and inside them have the loop that iterates through all the pins.

So it sort of goes - next pwmVals, now apply that value to all the pins, then get another pwmVals etc.

Steve