Adding code to PWM LED dimming

This program uses very convoluted logic. I would not mess with it at all. What they do with foo[] is just criminal. :slight_smile: