How to set a resistance between two points by a digital input
You likely want a digital potentiometer. In fact you can find ready implementations for the Arduino.

But since you say you're driving a LED array, a digital pot won't cut it. You want something else, like a TLC5940 (which also has an Arduino library available).


  The TLC5940 is a 16-channel, constant-current sink LED driver. Each channel has an individually adjustable 4096-step grayscale PWM brightness control and a 64-step, constant-current sink (dot correction).