Welcome

Grayscales

Ok, so by sending a frame worth of image data to the led-board, we can display an image. This is only a black-and-white (or black-and-red if you will) image, though: the shift registers only allow a LED to be completely on or completely off. It would be nice to get grayscales, though. Perhaps we can fix this hardware shortcoming in software?

With microcontrollers, we can use PWM to make a single LED appear dimmed. This works as follows: Take a counter, e.g. one which continuously counts up from 0 to 255. When the counter reaches 255, reset it back to zero and turn on the LED. When it reaches the number which corresponds to the intended brightness, turn it off again. If the counter runs quickly enough, the LED appears dimmed: the average current through the LED will be proportional to the intended brightness.

With the 512 LEDs on our LED-boards, we can do the same thing. Instead of sending one frame 50 times per seconds, we send e.g. 32 subframes 50 times per second. We have an array containing the brightness of every LED, on a scale from 0 to 31. At the begin of subframe 0, we turn on every LED. At the begin of every subframe, for every LED, we look if it's brightness number is equal or lower than the subframe number, and if so, we turn it off. This way, we can simulate PWM even with something as complex as a multiplexed LED-board with 512 LEDs.

« Prev 3 Next »


© 2006-2016 Sprite_tm - Contact