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

TolpuddleSartre:
You are writing the same value,(127), 255 times to the same pin.

That's definitely what it looks like. How do I increment that value?