|
|||||||
![]() |
Forum Index > Projects > LED Pegboard and Matrix Projects | ||
Meggy Jr: talking to the LED matrix |
|||
| | | Printable Version |
|
Anonymous: denis | ||||||||
|
I'm digging into the Meggy Jr library to understand how Meggy communicates with the LED PHP Formatted Code //Turn display off: PORTD |= 252U; PORTB |= 17U;
PHP Formatted Code //////////////////// Now set the row and latch the bits byte portbTemp = 0; byte portdTemp = 0; if (MeggyJr::currentCol == 0) portbTemp = 239U; else if (MeggyJr::currentCol == 1) portbTemp = 254U; else portdTemp = ~(1 << (9 - MeggyJr::currentCol)); while (!(SPSR & (1<<SPIF))) { } // wait for last bitshift to complete PORTB |= 4; //Latch Pulse if (MeggyJr::currentCol > 1) PORTD &= portdTemp; else PORTB &= portbTemp; |
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
The rows are switched on by high-performance PNP transistors, on the "high side" of the LED matrix. A PNP transistor allows current to flow from its emitter (connected to +V) to its collector (connected to the common anode of an LED row) when its base is pulled low such that current can flow from the emitter towards the base. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: denis | ||||||||
|
Thanks, Windell. I believe you have them marked as NPN in the schematic, though. |
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
>Thanks, Windell. I believe you have them marked as NPN in the schematic, though. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: denis | ||||||||
|
Not Pointing iN, lesson learned. |
|
||||||||
|
|||||||||
|
|
| All times are PDT. The time is now 10:33 PM. |
|
|
Octolively
Interactive LED kits
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits