System and method for controlling led lighting by distributed pwm