You are currently browsing the British Engineering Systems weblog archives for the day 12/02/2007.
12/02/2007 by peter.
People have commented to me about my post on PWM and wondering how it works. The basic idea it this. A byte of data is allocated to each colour red, green and blue giving 256 discrete levels for each or 16.7M coulours in total. A third byte is used as a counter. Firstly all three LEDs are turned on, then as the programme cycles it takes the counter value away from each of the RGB values and if the result is zero for one of these it turns off the appropriate LED. Once the counter reaches 255 it is reset and the LEDs turned on again. If you want more info on this i have written a programme for the PIC10F202 (the teeny wee microcontroller in a SOT23 form factor) which cycles through all 16.7M colours. what’s more the chip is so small you can actually embed it behind the LED!!
Posted in Stuff | Print | No Comments »