loading
16x8 LED dot matrix with MAX7219 module


The objective of this project is: to show off the use of the module "MAX7219 dot matrix display module MCU control DIY"
In order to using it you will need the module that can be purchased on ebay:

http://www.ebay.com/itm/171048735052?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

And you will need the MaxMatrix libraries files (which are 3):

https://docs.google.com/file/d/0B_YlEklLDDS7MDhRdWJKdmZQTnc/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7WE9lQ1F1aFhnYlE/edit?usp=sharing

https://docs.google.com/file/d/0B_YlEklLDDS7djd5T2JDeFVsaVE/edit?usp=sharing



The sketch with the code can be found on the link below:

https://docs.google.com/file/d/0B_YlEklLDDS7WTF0c2hlVzFCZWc/edit?usp=sharing


Or get all files at GitHub:
https://github.com/Arduinobymyself/Matrix16x8.git


See in the attached picture the interconnection diagram between Arduino module and MAX7219 module (it was used only 2 MAX7219 modules in this case):


Arduino pin 13 (alternative: pin 10) connected to the CLK pin of the module MAX7219
Arduino pin 11 (alternative: pin 8) connected to pin DIN module MAX7219
Arduino pin 10 (alternative: 9 pin) connected to pin CS module MAX7219
GND and VCC (+5V)

To expand the number of modules, you should just connect Dout pin of one MAX7219 module  with the Din pin of the another MAX7219 module... and so on.

The MAX7219 Dout pin is at the top of the module while Din pin is at the botton of the module.


Remembering that you can connect modules as you want, just connecting  the output of one module with the input of the other and leaving the other signals in parallel.
In the sketch, you should to modify the parameter "maxInUse" for the amount of modules that  you will use.





The video is just demo.
Remember that you can modify the messages in the code itself, or use the serial console to enter the message.

http://youtu.be/uG88Tt6Apoo




A second video using four MAX7219 modules.

http://youtu.be/yFx4r-WUp5g



New features were added to this project (on November 1st, 2014):

1 - 40x8 LED dot matrix;
2 - Start scrolling button;
3 - Speed control potentiometer;
4 - Intensity control

Some buttons were added as shown in schem above.

Here it is the new video showing these new features.
http://youtu.be/beo7N1SeYoE?list=UUgx66KiICvaM682IP4u7nng




Feel free to send me comments/questions/problems.




Best Regards


Marcelo Moraes
arduinobymyself.blogspot.com.br
arduinobymyself@gmail.com
Skype: marcelo.moraes

The Company

ArduinoByMyself is a non profitable entity. Our goal is to share knowledge and provide SW and HW free for everyone. We seek a better society and therefore we do not sell products but we give all the support for  everyone that want build their own project and we also give support for questions and problems as they needed.
We do not make projects by ordering  but every idea is valid and saved for future use  if interesting (technically and didactically speaking).
There are no copyrights in our projects, you can modify and use the code and description of how to do without legal implications (we only ask you to disclose "ArduinoByMyself" blog in order that other people also have access to the information contained in it).
<p>Hi Bd! Thanks a lot for sharing.<br>I have a huge favor to ask you. I found something extremely similar to this, but it seems that the connections between the MAX7219 and the LedMatrix are upside down. It is basically the same but somewhat upside down, and now I'm not sure which one to follow, because I don't know the risks of getting it backwards.<br>Could you please take a quick look at it and tell me if it is wrong?<br>http://wiring.org.co/learning/libraries/hellomatrix.html</p><p>Thank you very much!</p>
<p>Excellent instructable! This project went together in no time!</p>
<p>Is it possible to set the Matrix up as 32X16? so you have 2 rows of 4 max7219s and they scroll in sequence like each16x8 acts as one module?</p>
<p>Hey hannoc,</p><p>Did you find like project what is contained 2 rows?</p>
<p>No I haven't, but I haven't been looking too hard, Im still waiting for my parts to come from china</p>
I think Yes. But I had no code for this kind of project.<br><br>Thanks a lot for your comment.
<p>hi Bd,</p><p>I was manage to load this cod to my </p><p>Arudino but I need to shift to right to left please any one can help me to do this project or I can build shift register 8x8 o 16x16 led matrix to I need easy code for able to edit any one please help me </p><p>I am really appreciate </p><p>king regards</p><p>Jay </p>
<p>Hi...... Admin am very new to Arduino..... am very interested in ur Max 7219 scrolling text projects..n I have successfully uploaded ur Sketch 7219_8 to my Aurdino Nano Board after editing &quot;prog_uchar&quot; to &quot;const unsigned char&quot; but nothing displays why... pls note that am only using one Max7219 8*8 Module any Pin out problem or els pls help me out</p><p>Thanxx in advance</p>
<p>Hi I am quite new with electronics. I made this project and it is working till four max.</p><p>but this is not the problem I want to use attiny85 for this project by using only one dot matrix.</p><p>will you please help me if I can use attiny.</p><p>thanks and regards</p>
<p>its been an hour still the compiling doesnt stop :D what's the problem with it ? plsss help :) </p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>great video</p><p>but can u tell me how to do the same in a 8*8 single module also please give the editted sketch</p>
<p>With arduino 1.6.X (and perhaps before), there is an &quot;'prog_uchar' does not name a type&quot; error that can be corrected by commenting the line and change it for this:</p><p>//PROGMEM prog_uchar CH[] = {</p><p>PROGMEM const unsigned char CH[] = {</p><p>Later, I saw garbage on the output and also change printCharWithShift demo code first lines by these:</p><p>void printCharWithShift(char c, int shift_speed){</p><p> if (c &lt; 32 || c &gt; 127) return;</p><p> c -= 32;</p><p>instead of :</p><p>void printCharWithShift(char c, int shift_speed){<br>if (c &lt; 64) return;<br>c -= 64;</p><p>Now, it works like a sharm! </p><p>Thanks!</p>
<p>I found quite useful this project and straight forward, once a couple of bugs have been corrected for Arduino 1.6 and sample code mistakes...</p>
<p>How to use and modify the sketch on Arduino Due boards? Which pins sould to use and configure to controll the MAX7219?</p>
<p>I use UBuntu 14.04 Arduino IDE1:1.0.5 , when I Upload the code..</p><p>&quot;error: variable &lsquo;font&rsquo; must be const in order to be put into read-only section by means of &lsquo;__attribute__((progmem))&quot;, Any Idea?</p>
Dear, <br>Congro!! for project <br>Can I use 7219 for 24x6 matrix?? <br>My mail ID is salunkesantosh97@gmail.com <br>So tell me... how i can do?? <br>Thanks for time!!!
<p>Hello,</p><p>congratulations for the project !!!</p><p>I'd like to get help to realize this project using two MAX7219.</p><p>http://scuola.arduino.cc/lesson/l81bRbQ/Tabellone_Segnapunti.</p><p>I have some problem with the code is very urgent ...</p>
<p>Ciao,</p><p>complimenti per il Progetto !!!</p><p>Mi piacerebbe Ricevere Aiuto per Realizzare this Progetto utilizzando 2 MAX7219.</p><p>http://scuola.arduino.cc/lesson/l81bRbQ/Tabellone_Segnapunti.</p><p>Ho Qualche Problema con il codice ... &egrave; Molto urgente</p>
<p>I am really struggling with this. All my chars are appearing rotated 90 degrees counterclockwise, and shifting downwards instead of from right to left. Then when the character disappears from one LED block (I am using 7219's bought in a strip of four, all cascaded via jumpers, checked the in &gt; out, everything is OK) it starts reappearing on the block to the right, and so on.</p><p>I was trying to understand how the MaxMatrix.cpp works, playing with the writeDot function, but I can't figure out how to shift the bits the correct way in order to fix this issue.</p><p>Too frustrated right now. Anyone who has a clue is welcome to jump in.</p>
<p>Hi Werner,</p><p>I am also struggling with this.</p><p>I am hoping somebody can help</p>
<p>Hi Dirk</p><p>Marcelo was kind enough, to direct me to another library that is much more complete and configurable to many different matrices. It's called Parola and you can download it from this URL: </p><p><a href="https://parola.codeplex.com/releases" rel="nofollow">https://parola.codeplex.com/releases</a></p><p>This one works, but it requires you to configure some defines in its header file. Once you have downloaded and installed this library, go to the examples folder and there you will find a sketch to help you find the correct parameters for your display. Then open the header file and find the define that has these parameters and enable it.</p><p>It works a treat!</p>
<p>Hi Werner,</p><p>What did you change in your file?</p><p>Im trying to find the parameters but no result</p>
<p>The parameters to change depend on your type of hardware.</p><p>First, you need to have installed the MD_MAX72XX library (which is a dependancy to make Parola library work - as stated in Parola's main webpage: https://parola.codeplex.com/)</p><p>Then, within the MD_MAX72XX library's example sketches, find the one named MD_MAX72XX_HW_Mapper and load it with the Serial Monitor window open. Follow the instructions. </p><p>After finding out the 3 settings given out by the hw mapper sketch, edit the MD_MAX72xx_lib.h and find the define statement that has the same settings as the hw mapper told you. Note its name (e.g., &quot;#if USE_FC16_HW&quot;)</p><p>Now, edit the MD_MAX72xx.h file and find the define that has the same as noted above, and change its value to 1. Whatever else has a setting of 1 already, change it to 0.</p>
<p>I am having problems using any more that 4 modules?</p><p>Up to 4 and its working great!</p><p>If I add a fifth module then i get corrupted columns on the first module, iF i add a sixth I get more corrupted columns on the second display as well as corruption on all of the first?</p><p>I tried the change to the printCharWithShift Function as sugested to.. </p><p>void printCharWithShift(char c, int shift_speed){<br>if (c &lt; 64) return;<br>c -= 64;<br>memcpy_P(buffer, CH + 7*c, 7);<br>m.writeSprite(64, 0, buffer);<br>m.setColumn(64 + buffer[0], 0);<br></p><p>for (int i=0; i&lt;buffer[0]+1; i++)</p><p>delay(shift_speed);<br>m.shiftLeft(false, false);<br>}<br>}</p><p>...and this then used all six modules correctly but everything was in upper case and no spaces were shown?</p><p>Can anyone share some there code thats working for more than 4 modules?</p><p>Cheers</p>
<p>The constant value (let's call it 'xx') that's being left in the code will only allow for 'xx' / 8. So in order for the code to see as many display modules as desired, you need to replace the constant by <br></p><p>(maxInUse * 8)</p>
<p>Marcelo - First I would like to thank you for an excellent project! I have a number of units working well and find them fascinating!</p><p>Unfortunately I have the same problem as &quot;perryscope&quot; when I get above 5 modules. Even after editing the code (changing 32 to 64, etc) the display shows only upper case and some characters are not represented accurately at all.</p><p>Can you help with code that works reliably with six or more modules? I have materials to go to 10 modules and hope to get it working soon.</p><p>I apprecaite your help!</p><p>dave</p>
<p>The constant value (let's call it 'xx') that's being left in the code will only allow for 'xx' / 8. So in order for the code to see as many display modules as desired, you need to replace the constant by <br></p><p>(maxInUse * 8)</p>
<p>Good news! I spent some time experimenting today and have the software working well with up to 9 modules. Details of how this can be done are on my web page here:</p><p><a href="http://www.trainelectronics.com/Arduino/LED_Matrix/index.htm#Using_More_than_Four_Modules" rel="nofollow">http://www.trainelectronics.com/Arduino/LED_Matrix...</a></p><p>I was unable to get more than 9 working but hope that I or someone else will figure it out!</p><p>Again, Marcelo, thanks for your project!</p><p>dave</p>
<p>The constant value (let's call it 'xx') that's being left in the code will only allow for 'xx' / 8. So in order for the code to see as many display modules as desired, you need to replace the constant by <br></p><p>(maxInUse * 8)</p>
<p>Good news! I spent some time experimenting today and have the software working well with up to 9 modules. Details of how this can be done are on my web page here:</p><p><a href="http://www.trainelectronics.com/Arduino/LED_Matrix/index.htm#Using_More_than_Four_Modules" rel="nofollow">http://www.trainelectronics.com/Arduino/LED_Matrix...</a></p><p>I was unable to get more than 9 working but hope that I or someone else will figure it out!</p><p>Again, Marcelo, thanks for your project!</p><p>dave</p>
<p>The constant value (let's call it 'xx') that's being left in the code will only allow for 'xx' / 8. So in order for the code to see as many display modules as desired, you need to replace the constant by </p><p>(maxInUse * 8)</p>
<p>Thank you davebodnar!!!!!! Grazie alle tue fotografie sono riuscito a collegare tutto in modo funzionante!!!!!!!!!!!!!!!!!!! You are great!!!!!!</p>
<p>Hi Marcelo, or anyone who has made this project. </p><p>My problem is that with using any more than one matrix (2 or 3) then the text and scrolling effects are just duplicated on the 2nd and 3rd matrix ???? Basically as if they are working independently. Data in is serial connection and clock and cs are parallel. I have used other similar libraries and the same result. Begining to think the HW may be faulty. Any Ideas anyone? </p>
You must use the code as shown below (up to 8 modules are allowed).<br><br>#include <br>#include <br><br>PROGMEM prog_uchar CH[] = {<br>3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space<br>1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // !<br>3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // &quot;<br>5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // #<br>4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $<br>5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // %<br>5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // &amp;<br>1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // '<br>3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // (<br>3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // )<br>5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // *<br>5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // +<br>2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // ,<br>4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // -<br>2, 8, B01100000, B01100000, B00000000, B00000000, B00000000, // .<br>4, 8, B01100000, B00011000, B00000110, B00000001, B00000000, // /<br>4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // 0<br>3, 8, B01000010, B01111111, B01000000, B00000000, B00000000, // 1<br>4, 8, B01100010, B01010001, B01001001, B01000110, B00000000, // 2<br>4, 8, B00100010, B01000001, B01001001, B00110110, B00000000, // 3<br>4, 8, B00011000, B00010100, B00010010, B01111111, B00000000, // 4<br>4, 8, B00100111, B01000101, B01000101, B00111001, B00000000, // 5<br>4, 8, B00111110, B01001001, B01001001, B00110000, B00000000, // 6<br>4, 8, B01100001, B00010001, B00001001, B00000111, B00000000, // 7<br>4, 8, B00110110, B01001001, B01001001, B00110110, B00000000, // 8<br>4, 8, B00000110, B01001001, B01001001, B00111110, B00000000, // 9<br>2, 8, B01010000, B00000000, B00000000, B00000000, B00000000, // :<br>2, 8, B10000000, B01010000, B00000000, B00000000, B00000000, // ;<br>3, 8, B00010000, B00101000, B01000100, B00000000, B00000000, // &lt;<br>3, 8, B00010100, B00010100, B00010100, B00000000, B00000000, // =<br>3, 8, B01000100, B00101000, B00010000, B00000000, B00000000, // &gt;<br>4, 8, B00000010, B01011001, B00001001, B00000110, B00000000, // ?<br>5, 8, B00111110, B01001001, B01010101, B01011101, B00001110, // @<br>4, 8, B01111110, B00010001, B00010001, B01111110, B00000000, // A<br>4, 8, B01111111, B01001001, B01001001, B00110110, B00000000, // B<br>4, 8, B00111110, B01000001, B01000001, B00100010, B00000000, // C<br>4, 8, B01111111, B01000001, B01000001, B00111110, B00000000, // D<br>4, 8, B01111111, B01001001, B01001001, B01000001, B00000000, // E<br>4, 8, B01111111, B00001001, B00001001, B00000001, B00000000, // F<br>4, 8, B00111110, B01000001, B01001001, B01111010, B00000000, // G<br>4, 8, B01111111, B00001000, B00001000, B01111111, B00000000, // H<br>3, 8, B01000001, B01111111, B01000001, B00000000, B00000000, // I<br>4, 8, B00110000, B01000000, B01000001, B00111111, B00000000, // J<br>4, 8, B01111111, B00001000, B00010100, B01100011, B00000000, // K<br>4, 8, B01111111, B01000000, B01000000, B01000000, B00000000, // L<br>5, 8, B01111111, B00000010, B00001100, B00000010, B01111111, // M<br>5, 8, B01111111, B00000100, B00001000, B00010000, B01111111, // N<br>4, 8, B00111110, B01000001, B01000001, B00111110, B00000000, // O<br>4, 8, B01111111, B00001001, B00001001, B00000110, B00000000, // P<br>4, 8, B00111110, B01000001, B01000001, B10111110, B00000000, // Q<br>4, 8, B01111111, B00001001, B00001001, B01110110, B00000000, // R<br>4, 8, B01000110, B01001001, B01001001, B00110010, B00000000, // S<br>5, 8, B00000001, B00000001, B01111111, B00000001, B00000001, // T<br>4, 8, B00111111, B01000000, B01000000, B00111111, B00000000, // U<br>5, 8, B00001111, B00110000, B01000000, B00110000, B00001111, // V<br>5, 8, B00111111, B01000000, B00111000, B01000000, B00111111, // W<br>5, 8, B01100011, B00010100, B00001000, B00010100, B01100011, // X<br>5, 8, B00000111, B00001000, B01110000, B00001000, B00000111, // Y<br>4, 8, B01100001, B01010001, B01001001, B01000111, B00000000, // Z<br>2, 8, B01111111, B01000001, B00000000, B00000000, B00000000, // [<br>4, 8, B00000001, B00000110, B00011000, B01100000, B00000000, // \ backslash<br>2, 8, B01000001, B01111111, B00000000, B00000000, B00000000, // ]<br>3, 8, B00000010, B00000001, B00000010, B00000000, B00000000, // hat<br>4, 8, B01000000, B01000000, B01000000, B01000000, B00000000, // _<br>2, 8, B00000001, B00000010, B00000000, B00000000, B00000000, // `<br>4, 8, B00100000, B01010100, B01010100, B01111000, B00000000, // a<br>4, 8, B01111111, B01000100, B01000100, B00111000, B00000000, // b<br>4, 8, B00111000, B01000100, B01000100, B00101000, B00000000, // c<br>4, 8, B00111000, B01000100, B01000100, B01111111, B00000000, // d<br>4, 8, B00111000, B01010100, B01010100, B00011000, B00000000, // e<br>3, 8, B00000100, B01111110, B00000101, B00000000, B00000000, // f<br>4, 8, B10011000, B10100100, B10100100, B01111000, B00000000, // g<br>4, 8, B01111111, B00000100, B00000100, B01111000, B00000000, // h<br>3, 8, B01000100, B01111101, B01000000, B00000000, B00000000, // i<br>4, 8, B01000000, B10000000, B10000100, B01111101, B00000000, // j<br>4, 8, B01111111, B00010000, B00101000, B01000100, B00000000, // k<br>3, 8, B01000001, B01111111, B01000000, B00000000, B00000000, // l<br>5, 8, B01111100, B00000100, B01111100, B00000100, B01111000, // m<br>4, 8, B01111100, B00000100, B00000100, B01111000, B00000000, // n<br>4, 8, B00111000, B01000100, B01000100, B00111000, B00000000, // o<br>4, 8, B11111100, B00100100, B00100100, B00011000, B00000000, // p<br>4, 8, B00011000, B00100100, B00100100, B11111100, B00000000, // q<br>4, 8, B01111100, B00001000, B00000100, B00000100, B00000000, // r<br>4, 8, B01001000, B01010100, B01010100, B00100100, B00000000, // s<br>3, 8, B00000100, B00111111, B01000100, B00000000, B00000000, // t<br>4, 8, B00111100, B01000000, B01000000, B01111100, B00000000, // u<br>5, 8, B00011100, B00100000, B01000000, B00100000, B00011100, // v<br>5, 8, B00111100, B01000000, B00111100, B01000000, B00111100, // w<br>5, 8, B01000100, B00101000, B00010000, B00101000, B01000100, // x<br>4, 8, B10011100, B10100000, B10100000, B01111100, B00000000, // y<br>3, 8, B01100100, B01010100, B01001100, B00000000, B00000000, // z<br>3, 8, B00001000, B00110110, B01000001, B00000000, B00000000, // {<br>1, 8, B01111111, B00000000, B00000000, B00000000, B00000000, // |<br>3, 8, B01000001, B00110110, B00001000, B00000000, B00000000, // }<br>4, 8, B00001000, B00000100, B00001000, B00000100, B00000000, // ~<br>};<br><br>int data = 8; // DIN pin of MAX7219 module<br>int load = 9; // CS pin of MAX7219 module<br>int clock = 10; // CLK pin of MAX7219 module<br><br>int maxInUse = 4; //change this variable to set how many MAX7219's you'll use<br><br>MaxMatrix m(data, load, clock, maxInUse); // define module<br><br>byte buffer[100];<br><br>// active sentenses<br>char string1[] = &quot; Hello, my name is ... &quot;;<br>char string2[] = &quot; I am glad to show you my Arduino scrolling dot Matrix &quot;;<br>char string3[] = &quot; using MAX7219 IC &quot;;<br>char string4[] = &quot; up to 8 modules &quot;;<br>char string5[] = &quot; There you will find a lot of projects with Arduino. &quot;;<br>char string6[] = &quot; =) &quot;;<br><br>// just for tests<br>char string7[] = &quot; A B C D E F G H I J K L M N O P Q R S T U V X W Y Z &quot;;<br>char string8[] = &quot; a b c d e f g h i j k l m n o p q r s t u v x w y z &quot;;<br>char string9[] = &quot; 1 2 3 4 5 6 7 8 9 0 - = &quot;;<br>char string10[] = &quot; ! @ # $ % &uml; &amp; * ( ) _ + &quot;;<br>char string11[] = &quot; ' , . ; ~ ] &acute; [ | &lt; &gt; : ^ } ` { / ? &quot;;<br><br>void setup(){<br> m.init(); // module initialize<br> m.setIntensity(5); // dot matix intensity 0-15<br> Serial.begin(9600); // serial communication initialize<br>}<br><br>void loop(){<br> <br> // this is the code if you want to entering a message via serial console<br> while (Serial.available() &gt; 0){<br> byte c = Serial.read();<br> Serial.println(c, DEC);<br> printCharWithShift(c, 100);<br> }<br> delay(100);<br> m.shiftLeft(false, true);<br> <br> /*<br> // print the active sentences<br> printStringWithShift(string1, 100);<br> printStringWithShift(string2, 100);<br> printStringWithShift(string3, 100);<br> printStringWithShift(string4, 100);<br> printStringWithShift(string5, 100);<br> printStringWithShift(string6, 100);<br> */<br><br> <br>}<br><br>void printCharWithShift(char c, int shift_speed){<br> if (c &lt; 64) return;<br> c -= 64;<br> memcpy_P(buffer, CH + 7*c, 7);<br> m.writeSprite(64, 0, buffer);<br> m.setColumn(64 + buffer[0], 0);<br> <br> for (int i=0; i {<br> delay(shift_speed);<br> m.shiftLeft(false, false);<br> }<br>}<br><br>void printStringWithShift(char* s, int shift_speed){<br> while (*s != 0){<br> printCharWithShift(*s, shift_speed);<br> s++;<br> }<br>}<br>
<p>Hi Author, I'm not able to understand the char array definitions for mapping a character, from the code above you have mentioned 4, 8, B00001000, B00000100, what is 4 and 8 here?</p><p>thanks in advance</p><p>Regards</p><p>Venkat</p>
<p>You'll need to look at the MaxMatrix library source file, writeSprite function will give you a clue what those numbers are for.</p>
do not forget to modify the MAXINUSE code line to the amount of modules you are using.
<p>Arduino: 1.6.0 (Windows 8), Board: &quot;Arduino Uno&quot;<br><br>Build options changed, rebuilding all<br><br>In file included from Scroll.ino:1:0:<br>Scroll.ino:15:23: error: variable 'font' must be const in order to be put into read-only section by means of '__attribute__((progmem))'<br>Error compiling.<br><br> This report would have more information with<br> &quot;Show verbose output during compilation&quot;<br> enabled in File &gt; Preferences.</p>
<p>Hi, <br>To those getting an &quot;error: 'prog_uchar' does not name a type&quot; message:<br>You need to replace 'prog_uchar' with 'const unsigned char'<br><br>My problem is different: All characters appear rotated 90 degrees counterclockwise, and shifting from upwards to downwards. Not sure whether this is fixed by changing the character map or this needs to be fixed in the library functions themselves.<br><br>Anyone else having this problem?</p><p>Marcelo, para vc entender: meu problema &eacute; que os caracteres est&atilde;o aparecendo no display rotacionados em 90 graus sentido anti-horario, e o shift est&aacute; ocorrendo de cima para baixo. A sua planilha excel n&atilde;o est&aacute; funcionando, eu n&atilde;o consigo alterar a cor dos blocos quando escrevo '1' em um deles (fica sempre desenhada a letra 'r').</p><p>Abra&ccedil;os.</p>
<p>Hi,</p><p>I'm getting an error:</p><p>MAX7219_5.ino:31:7: error: 'prog_uchar' does not name a type</p><p>How can i fix this?</p>
<p>Hi, you need to replace '</p><p>'prog_uchar'</p><p>with </p><p>'const unsigned char'</p>
<p>Hey guys thanks for the video.I tried this out and made some progress as such but there is one issue.</p><p>1.The text that is scrolling is really hard to read as the brightness of the LED's surrounding the one which scroll both glow at almost same intensity.</p><p>The Code is am using is as follows:</p><p>#include &lt;avr/pgmspace.h&gt; <br>#include &quot;LedControl.h&quot;<br>#include &lt;TimerOne.h&gt; <br><br>int DataPin = 2; <br>int LoadPin = 3; <br>int ClockPin = 4; <br>byte buffer[8]; <br><br>#define SCAN_LIMIT_REG 0x0B <br>#define DECODE_MODE_REG 0x09 <br>#define SHUTDOWN_REG 0x0C <br>#define INTENSITY_REG 0x0A <br><br>static byte font[][8] PROGMEM = <br>{<br>{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000},<br>{B00000100, B00000100, B00000100, B00000100, B00000100, B00000100, B00000000, B00000100}, <br>{B00001010, B00001010, B00001010, B00000000, B00000000, B00000000, B00000000, B00000000}, <br>{B00000000, B00001010, B00011111, B00001010, B00011111, B00001010, B00011111, B00001010},<br>{B00000111, B00001100, B00010100, B00001100, B00000110, B00000101, B00000110, B00011100}, <br>{B00011001, B00011010, B00000010, B00000100, B00000100, B00001000, B00001011, B00010011}, <br>{B00000110, B00001010, B00010010, B00010100, B00001001, B00010110, B00010110, B00001001}, <br>{B00000100, B00000100, B00000100, B00000000, B00000000, B00000000, B00000000, B00000000}, <br>{B00000010, B00000100, B00001000, B00001000, B00001000, B00001000, B00000100, B00000010}, <br>{B00001000, B00000100, B00000010, B00000010, B00000010, B00000010, B00000100, B00001000}, <br>{B00010101, B00001110, B00011111, B00001110, B00010101, B00000000, B00000000, B00000000}, <br>{B00000000, B00000000, B00000100, B00000100, B00011111, B00000100, B00000100, B00000000},<br>{B00000000, B00000000, B00000000, B00000000, B00000000, B00000110, B00000100, B00001000},<br>{B00000000, B00000000, B00000000, B00000000, B00001110, B00000000, B00000000, B00000000}, <br>{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000100},<br>{B00000001, B00000010, B00000010, B00000100, B00000100, B00001000, B00001000, B00010000},<br>{B00001110, B00010001, B00010011, B00010001, B00010101, B00010001, B00011001, B00001110},<br>{B00000100, B00001100, B00010100, B00000100, B00000100, B00000100, B00000100, B00011111},<br>{B00001110, B00010001, B00010001, B00000010, B00000100, B00001000, B00010000, B00011111}, <br>{B00001110, B00010001, B00000001, B00001110, B00000001, B00000001, B00010001, B00001110},<br>{B00010000, B00010000, B00010100, B00010100, B00011111, B00000100, B00000100, B00000100},<br>{B00011111, B00010000, B00010000, B00011110, B00000001, B00000001, B00000001, B00011110},<br>{B00000111, B00001000, B00010000, B00011110, B00010001, B00010001, B00010001, B00001110}, <br>{B00011111, B00000001, B00000001, B00000001, B00000010, B00000100, B00001000, B00010000}, <br>{B00001110, B00010001, B00010001, B00001110, B00010001, B00010001, B00010001, B00001110}, <br>{B00001110, B00010001, B00010001, B00001111, B00000001, B00000001, B00000001, B00000001}, <br>{B00000000, B00000100, B00000100, B00000000, B00000000, B00000100, B00000100, B00000000}, <br>{B00000000, B00000100, B00000100, B00000000, B00000000, B00000100, B00000100, B00001000}, <br>{B00000001, B00000010, B00000100, B00001000, B00001000, B00000100, B00000010, B00000001}, <br>{B00000000, B00000000, B00000000, B00011110, B00000000, B00011110, B00000000, B00000000},<br>{B00010000, B00001000, B00000100, B00000010, B00000010, B00000100, B00001000, B00010000}, <br>{B00001110, B00010001, B00010001, B00000010, B00000100, B00000100, B00000000, B00000100}, <br>{B00001110, B00010001, B00010001, B00010101, B00010101, B00010001, B00010001, B00011110}, <br>{B00001110, B00010001, B00010001, B00010001, B00011111, B00010001, B00010001, B00010001}, <br>{B00011110, B00010001, B00010001, B00011110, B00010001, B00010001, B00010001, B00011110}, <br>{B00000111, B00001000, B00010000, B00010000, B00010000, B00010000, B00001000, B00000111}, <br>{B00011100, B00010010, B00010001, B00010001, B00010001, B00010001, B00010010, B00011100}, <br>{B00011111, B00010000, B00010000, B00011110, B00010000, B00010000, B00010000, B00011111}, <br>{B00011111, B00010000, B00010000, B00011110, B00010000, B00010000, B00010000, B00010000}, <br>{B00001110, B00010001, B00010000, B00010000, B00010111, B00010001, B00010001, B00001110},<br>{B00010001, B00010001, B00010001, B00011111, B00010001, B00010001, B00010001, B00010001},<br>{B00011111, B00000100, B00000100, B00000100, B00000100, B00000100, B00000100, B00011111},<br>{B00011111, B00000100, B00000100, B00000100, B00000100, B00000100, B00010100, B00001000},<br>{B00010001, B00010010, B00010100, B00011000, B00010100, B00010010, B00010001, B00010001}, <br>{B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00011111},<br>{B00010001, B00011011, B00011111, B00010101, B00010001, B00010001, B00010001, B00010001}, <br>{B00010001, B00011001, B00011001, B00010101, B00010101, B00010011, B00010011, B00010001},<br>{B00001110, B00010001, B00010001, B00010001, B00010001, B00010001, B00010001, B00001110}, <br>{B00011110, B00010001, B00010001, B00011110, B00010000, B00010000, B00010000, B00010000}, <br>{B00001110, B00010001, B00010001, B00010001, B00010001, B00010101, B00010011, B00001111}, <br>{B00011110, B00010001, B00010001, B00011110, B00010100, B00010010, B00010001, B00010001}, <br>{B00001110, B00010001, B00010000, B00001000, B00000110, B00000001, B00010001, B00001110}, <br>{B00011111, B00000100, B00000100, B00000100, B00000100, B00000100, B00000100, B00000100}, <br>{B00010001, B00010001, B00010001, B00010001, B00010001, B00010001, B00010001, B00001110}, <br>{B00010001, B00010001, B00010001, B00010001, B00010001, B00010001, B00001010, B00000100}, <br>{B00010001, B00010001, B00010001, B00010001, B00010001, B00010101, B00010101, B00001010}, <br>{B00010001, B00010001, B00001010, B00000100, B00000100, B00001010, B00010001, B00010001}, <br>{B00010001, B00010001, B00001010, B00000100, B00000100, B00000100, B00000100, B00000100}, <br>{B00011111, B00000001, B00000010, B00000100, B00001000, B00010000, B00010000, B00011111}, <br>{B00001110, B00001000, B00001000, B00001000, B00001000, B00001000, B00001000, B00001110}, <br>{B00010000, B00001000, B00001000, B00000100, B00000100, B00000010, B00000010, B00000001}, <br>{B00001110, B00000010, B00000010, B00000010, B00000010, B00000010, B00000010, B00001110}, <br>{B00000100, B00001010, B00010001, B00000000, B00000000, B00000000, B00000000, B00000000}, <br>{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111}, <br>{B00001000, B00000100, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}, <br>{B00000000, B00000000, B00000000, B00001110, B00010010, B00010010, B00010010, B00001111}, <br>{B00000000, B00010000, B00010000, B00010000, B00011100, B00010010, B00010010, B00011100}, <br>{B00000000, B00000000, B00000000, B00001110, B00010000, B00010000, B00010000, B00001110}, <br>{B00000000, B00000001, B00000001, B00000001, B00000111, B00001001, B00001001, B00000111}, <br>{B00000000, B00000000, B00000000, B00011100, B00010010, B00011110, B00010000, B00001110}, <br>{B00000000, B00000011, B00000100, B00000100, B00000110, B00000100, B00000100, B00000100}, <br>{B00000000, B00001110, B00001010, B00001010, B00001110, B00000010, B00000010, B00001100}, <br>{B00000000, B00010000, B00010000, B00010000, B00011100, B00010010, B00010010, B00010010}, <br>{B00000000, B00000000, B00000100, B00000000, B00000100, B00000100, B00000100, B00000100}, <br>{B00000000, B00000010, B00000000, B00000010, B00000010, B00000010, B00000010, B00001100}, <br>{B00000000, B00010000, B00010000, B00010100, B00011000, B00011000, B00010100, B00010000}, <br>{B00000000, B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00001100}, <br>{B00000000, B00000000, B00000000, B00001010, B00010101, B00010001, B00010001, B00010001}, <br>{B00000000, B00000000, B00000000, B00010100, B00011010, B00010010, B00010010, B00010010}, <br>{B00000000, B00000000, B00000000, B00001100, B00010010, B00010010, B00010010, B00001100}, <br>{B00000000, B00011100, B00010010, B00010010, B00011100, B00010000, B00010000, B00010000}, <br>{B00000000, B00001110, B00010010, B00010010, B00001110, B00000010, B00000010, B00000001}, <br>{B00000000, B00000000, B00000000, B00001010, B00001100, B00001000, B00001000, B00001000}, <br>{B00000000, B00000000, B00001110, B00010000, B00001000, B00000100, B00000010, B00011110}, <br>{B00000000, B00010000, B00010000, B00011100, B00010000, B00010000, B00010000, B00001100},<br>{B00000000, B00000000, B00000000, B00010010, B00010010, B00010010, B00010010, B00001100}, <br>{B00000000, B00000000, B00000000, B00010001, B00010001, B00010001, B00001010, B00000100}, <br>{B00000000, B00000000, B00000000, B00010001, B00010001, B00010001, B00010101, B00001010}, <br>{B00000000, B00000000, B00000000, B00010001, B00001010, B00000100, B00001010, B00010001}, <br>{B00000000, B00000000, B00010001, B00001010, B00000100, B00001000, B00001000, B00010000}, <br>{B00000000, B00000000, B00000000, B00011111, B00000010, B00000100, B00001000, B00011111}, <br>{B00000010, B00000100, B00000100, B00000100, B00001000, B00000100, B00000100, B00000010}, <br>{B00000100, B00000100, B00000100, B00000100, B00000100, B00000100, B00000100, B00000100}, <br>{B00001000, B00000100, B00000100, B00000100, B00000010, B00000100, B00000100, B00001000}, <br>{B00000000, B00000000, B00000000, B00001010, B00011110, B00010100, B00000000, B00000000} <br>};<br><br>void clearDisplay() <br>{ <br>for (byte x=0; x&lt;8; x++) <br>{ <br>buffer[x] = B00000000; <br>}<br>screenUpdate(); <br>} <br><br>void initMAX7219() <br>{ <br>pinMode(DataPin, OUTPUT); <br>pinMode(LoadPin, OUTPUT); <br>pinMode(ClockPin, OUTPUT); <br>clearDisplay(); <br>writeData(SCAN_LIMIT_REG, B00000111); <br>writeData(DECODE_MODE_REG, B00000000); <br>writeData(SHUTDOWN_REG, B00000001); <br>intensity(15); <br>} <br>void intensity(int intensity) <br>{ <br>writeData(INTENSITY_REG, intensity); <br>} <br>void writeData(byte msb, byte lsb) <br>{ <br> digitalWrite(LoadPin, LOW); <br> shiftOut(DataPin, ClockPin, MSBFIRST, (msb)); <br> shiftOut(DataPin, ClockPin, MSBFIRST, (lsb)); <br> digitalWrite(LoadPin, HIGH); <br>} <br>void scroll(char myString[], int rate) { <br>byte firstChrRow, secondChrRow; <br>byte ledOutput; <br>byte chrIndex = 0; <br>byte Char1, Char2; <br>byte scrollBit = 0; <br>byte strLength = 0; <br>unsigned long time; <br>unsigned long counter; <br>while (myString[strLength]) <br>{ <br>strLength++;<br>} <br>counter = millis(); <br>while (chrIndex &lt; (strLength)) <br>{ <br>time = millis(); <br>if (time &gt; (counter + rate)) <br>{ <br>Char1 = constrain(myString[chrIndex],32,126); <br>Char2 = constrain(myString[chrIndex+1],32,126); <br>for (byte y= 0; y&lt;8; y++) <br>{ <br>firstChrRow = pgm_read_byte(&amp;font[Char1 - 32][y]); <br>secondChrRow = (pgm_read_byte(&amp;font[Char2 - 32][y])) &lt;&lt; 1;<br>ledOutput = (firstChrRow &lt;&lt; scrollBit)|(secondChrRow &gt;&gt; (8 - scrollBit) ); <br>buffer[y] = ledOutput; <br>} <br>scrollBit++; <br>if (scrollBit &gt; 6) <br>{ <br>scrollBit = 0; <br>chrIndex++; <br>} <br>counter = millis(); <br>} <br>} <br>} <br>void screenUpdate() <br>{ <br>for (byte row = 0; row &lt; 8; row++) <br>{ <br>writeData(row+1, buffer[row]); <br>} <br>} <br>void setup() <br>{ <br>initMAX7219(); <br>Timer1.initialize(10000); <br>Timer1.attachInterrupt(screenUpdate); <br>Serial.begin(9600); <br>} <br>void loop() <br>{ <br>clearDisplay(); <br>scroll(&quot;12345&quot;, 1000); <br>scroll(&quot; Chapter 7 - LED Displays &quot;, 200); <br>scroll(&quot; HELLO WORLD!!! :) &quot;, 200); <br>} </p><p>___________________________________________________________________</p><p>Also i have connected the MAX 7219 with a Led Matrix That is a little different .</p>
<p>great videos :)</p><p>i have questions:</p><p>is it possible use this code for raspberry pi?</p>
<p>Hi,<br> <br>how if i use 5x8 dot matrix....<br><br>can you halp me,,,,,<br></p>

About This Instructable

124,658 views

136 favorites

License:

Bio: I am 43 years old and I live in Brazil. I am a Telecommunication / Electronics Engineer. Sixteen years acting in the industry of "Telecommunication and ... More »
More by BIGDOG1971: ARDUINO By Myself Mini-CNC (Plotter) ROVER Bot - The Arduino Bluetooth Controlled Tank WATERING SYSTEM - INTRODUCTION
Add instructable to: