??? 03/16/07 20:35 Read: times |
#135143 - added bonus: Blink! Responding to: ???'s previous message |
For my current project, I've got a matrix of LEDs (organized as 5 columns and 8 rows). In addition to the matrixing, I've added a "blink" feature, which makes selected LEDs blink at a 500 ms rate.
The mechanism is simple: first you have the usual timebase that generates the matrixing. You also need an array or whatever of bits that indicate which LEDs are on (I have a five-byte array, one byte for each column, each bit in the column indicates a row). Add another timebase that expires every 250 ms, and in that timer's ISR, simply toggle a "blink" bit. You also need to maintain an array of "which bits blink" similar to the LED on array (again, five bytes in my case). Back in the ISR that handles the matrixing, check the "blink" bit. If it's on, that means the blinking LEDs are on, so turn all of the enabled (blinking or not) LEDs on. If the "blink" bit is off, use the blink-pattern array to mask the blinking LEDs off. Next week, I get some boards where I use this. Once I verify that my code does what I say it does, I'll post it. -a |
Topic | Author | Date |
Help with the led matrix logic. | 01/01/70 00:00 | |
5x8 Dot Matrix display? | 01/01/70 00:00 | |
Try Shift Register | 01/01/70 00:00 | |
Some Help | 01/01/70 00:00 | |
hmm | 01/01/70 00:00 | |
refresh rate | 01/01/70 00:00 | |
nope | 01/01/70 00:00 | |
eyes | 01/01/70 00:00 | |
added bonus: Blink! | 01/01/70 00:00 | |
"fulfilling" a request?? | 01/01/70 00:00 | |
nah, just being generous | 01/01/70 00:00 | |
kudos | 01/01/70 00:00 | |
matrix means | 01/01/70 00:00 | |
Thanks | 01/01/70 00:00 | |
Got it working | 01/01/70 00:00 | |
maybe![]() | 01/01/70 00:00 |