How to Flicker an LED
In the last tutorial we covered how not to blink an LED , where I explained what was wrong with the most common blink example and showed a much more elegant solution. We now have an LED that switches between 'Off' and 'Blindingly Bright', there has to be another way that gives us more control over the LED, reduces the brightness (and therefore power consumption) and that could also give us a bit more 'character' for our lights. The answer is Pulse Width Modulation , or PWM for short. By switching the LED power on and off, imperceptibly quickly we can control the average amount of Voltage that is supplied to the LED, which in turn reduces the current and brightness of the LED. If we switch the power on and off faster than the LED can react, the LED will receive an average Voltage that is proportional to the ratio between on and off. If the LED is on for half the time and off for half the time it will receive half of the full voltage. It is possible to create the...