LED Matrix

Only available on StudyMode
  • Topic: Column, Flip-flop, Bit
  • Pages : 7 (1352 words )
  • Download(s) : 208
  • Published : February 22, 2013
Open Document
Text Preview
/*
Arduino 56x8 scrolling LED Matrix

Scrolls any message on up to seven (or more?) 8x8 LED matrices. Adjust the bitmap array below to however many matrices you want to use. You can start with as few as two.

The circuit:
* 1 8-bit shift register (SN74HC595) to drive the rows of all displays. * N power 8-bit shift registers (TPIC6C595) to drive the columns (1 chip per display) * N 8x8 LED matrix display (rows=Anodes, cold=cathodes)

* N * 8 470ohm resistors, one for each column of each display * 1 10K resistor
* A big breadboard, or several small ones
* Lots and lots of wires. AT LEAST 16 wires for each display. * If you plan on driving more than 8 displays, you should add 8 transistors to drive the rows because potentially you would be lighting up the whole row at one time (56 LEDs at once in my case, 8*n in your case)

Wiring tips:
* Key to success is to put the chips on the left and/or right of the matrix rather than above or below. This would allow you to run wires above and below the matrix without covering any of them. * I used several power bus breadboard strips above and below the matrix so all row wires never has to cross the matrix. * Wire up each matrix one at a time, turning on the Ardunio to verify your work before proceeding to the next matrix. Correcting your work after you have 32 wires over it is very difficult. * Circuit is available at:

http://g33k.blogspot.com/2010/02/arduino-56x8-scrolling-led-matrix.html

Created Feb 2010
By Hari Wiguna
http://g33k.blogspot.com/

Based on things I learn from the Arduino website.
Special credit to aspro648 creating the alphabet that I use. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1203747843/22

Creative Commons Attribution-Share Alike 3.0 United States License

*/
// I kept these version notes to show you that it doesn't just all magically happen. I start simple and keep adding more. //v01 - Just see if we can drive one matrix, one dot at a time. Forget multiplexing for now. //v02 - All three displays show same pattern because they are all tied to same data line. //v03 - Second and third 595 inputs are tied to outputs of previous, so now shiftout three bytes instead of one. //v04 - Let's multiplex. This version has no bleeding, but still flickers quite a bit. //v05 - Flicker is reduced by using delayMicroseconds() instead of delay(). Flipping both latches HIGH at same time increases brightess of all LEDs. //v06 - let's animate! (none of this code is in v09, I removed them because they're unrelated to the marquee. //v07 - We got a scrolling message marquee!

//v08 - Now with SEVEN matrices! 56x8 pixels
//v09 - Add comments and remove experimental code
//v10 - Fixed search and replace error in Plot. Thanks to Capacea for catching this error.

//-- Columns (Negative Cathodes) --
int latchPin1 = 2; //Arduino pin connected to Green 10 RCK of TPIC6C595 int clockPin1 = 3; //Arduino pin connected to Yellow 15 SRCK of TPIC6C595 int dataPin1 = 4; //Arduino pin connected to Blue 2 SER IN of TPIC6C595

//-- Rows (Positive Anodes) --
int latchPin2 = 5; //Arduino pinn connected to Green Latch 12 ST_CP / RCK of 74HC595 int clockPin2 = 6; //Arduino pin connected to Yellow Clock 11 SH_CP / SCK of 74HC595 int dataPin2 = 7; //Arduino pin connected to Blue Data 14 DS / SI of 74HC595

//=== B I T M A P ===
//Bits in this array represents one LED of the matrix
// 8 is # of rows, 7 is # of LED matrix we have
byte bitmap[8][7]; // Change the 7 to however many matrices you want to use. int numZones = sizeof(bitmap) / 8; // I will refer to each group of 8 columns (represented by one matrix) as a Zone. int maxZoneIndex = numZones-1;

int numCols = numZones * 8;

//=== F O N T ===
// Font courtesy of aspro648
// http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1203747843/22 // First char is @, next is A, B, etc. Only lower case, no symbols. // The @ will display as space character.
byte alphabets[][5] = {
{0,0,0,0,0},
{31, 36, 68,...
tracking img