![]() ![]() ![]() If you thought it would just be a sequential order, you'd be wrong. Check LedMatrix.c to figure out in what order you need to set these pins to. Set the Demux lines to display the current pair of rows.If you forget to do this, you'll have strange ghosting effects (because the matrix will be on while you're updating it). Set OE (output enable, it's active low) to high, turning off the display.The basic algorithm for driving the matrix is as follows: Sparkfun's tutorial and hookup guide for the matrix (note, I had to swap both of the green and blue pins as well as the OE and latch pins compared to the sparkfun pinout, your mileage may vary).Adafruit's tutorial on how to use the matrix.Example code of how to drive the matrix with a teensy board.A detailed breakdown and explanation of the LED matrix hardware by Ray's Logic. ![]() The following links will help you understand how the hardware and timing of the LED Matrix actually function: I highly recommend BatSock's tutorial for understanding BCM better: Understanding the LED Matrix ![]() This will dim the LED 23% compared to just driving it at full brightness. This equates to the LED being on for 10 of the 13 ticks, or for 77% of the time. If you want to display red at brightness 10 (out of 15 for 4-bit BCM), the red LED would be on for two ticks on the second bit and eight ticks on the fourth bit (in binary, ten is 0b1010 which means the LED will be turned on for the second and fourth bits). When displaying each pixel, you display the least significant bit for 1 "tick", the second bit for 2 "ticks", the third bit for 4 "ticks", and the last bit for 8 "ticks". Let's say we're going to implement 4-bit BCM (each pixel has 4-bits of color for each red, green, and blue LED). Since each "pixel" on the matrix actually contains three LEDs (red, green, and blue), by varying the brightness of those three LEDs you can achieve more than just the eight colors provided by only controlling three LEDs with no brightness control (black, white, red, green, blue, yellow, magenta, cyan).īinary Coded Modulation works on the principle of turning each LED on and off so quickly that (to the human eye) it appears to have dimmed. Unfortunately, the LED driver chips on this matrix only support a simple on/off for each LED. A common approach to dimming LEDs is through Pulse Width Modulation (PWM). Essentially, BCM is a technique used to dim certain LEDs on the matrix. Binary Coded Modulationīefore understanding how the LED Matrix is being driven, you need to understand the concept of Binary Coded Modulation (BCM). Your goal, as in the original pacman game, is to collect as many pellets as you can before a ghost catches you. "w" is up, "a" is left, "s" is down, and "d" is right. You move around using the "w", "a", "s", and "d" characters. You can either connect it to your computer through a USB to UART converter, or by attaching a bluetooth wireless UART (like any common HC-05 module) and connect to your computer over bluetooth. This chip can run up to 80MHz which is enough to drive the matrix as well as perform game logic.Ĭurrently, the Pacman character is controlled over the UART. The microcontroller used to drive the LED matrix is a TI Tiva C launchpad board containing a TM4C123GH6PM chip. The LED Matrix is the RGB LED Panel from sparkfun and is driven fast enough to be able to display 7-bits of color information per color (R, G, and B). A simple Pacman game running on a 32x32 RGB LED Matrix. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |