Components and supplies
LED Dot Matrix Display, Red
Arduino Nano R3
Apps and platforms
Arduino IDE
Project description
Code
LCDMatrix.ino
c_cpp
1#include <LedControl.h> 2 3int DIN = 12; 4int CS = 11; 5int CLK = 10; 6 7byte a[8]= {0x00,0xE9,0x89,0xE9,0x29,0xEF,0x00,0x00,}; 8byte b[8]= {0x00,0xE7,0x94,0xE7,0x91,0xE7,0x00,0x00,}; 9byte c[8]= {0x00,0xEC,0x8A,0x8C,0x8A,0xEA,0x00,0x00,}; 10byte d[8]= {0x00,0xEE,0x49,0x4E,0x49,0xEE,0x00,0x00,}; 11byte e[8]= {0x00,0xF0,0x80,0xF0,0x80,0xF0,0x00,0x00,}; 12 13 14LedControl lc=LedControl(DIN,CLK,CS,0); 15 16void setup(){ 17 lc.shutdown(0,false); //The MAX72XX is in power-saving mode on startup 18 lc.setIntensity(0,15); // Set the brightness to maximum value 19 lc.clearDisplay(0); // and clear the display 20} 21 22void loop(){ 23 24 byte f[8]= {0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,}; 25 byte g[8]= {0xFF,0x99,0x00,0x00,0x81,0xC3,0xE7,0xFF,}; 26 byte h[8]= {0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,}; 27 byte i[8] = {0xFF,0x99,0x00,0x00,0x81,0xC3,0xE7,0xFF,}; 28 29 printByte(f); 30 31 delay(1000); 32 33 printByte(g); 34 35 delay(1000); 36 37 printByte(h); 38 39 delay(1000); 40 41 printByte(i); 42 43 delay(1000); 44 45 printEduc8s(); 46 47 lc.clearDisplay(0); 48 49 delay(1000); 50} 51 52void printEduc8s() 53{ 54 printByte(a); 55 delay(1000); 56 printByte(b); 57 delay(1000); 58 printByte(c); 59 delay(1000); 60 printByte(d); 61 delay(1000); 62 printByte(e); 63 delay(1000); 64 65 66} 67 68void printByte(byte character []) 69{ 70 int i = 0; 71 for(i=0;i<8;i++) 72 { 73 lc.setRow(0,i,character[i]); 74 } 75} 76
LCDMatrix.ino
c_cpp
1#include <LedControl.h> 2 3int DIN = 12; 4int CS = 11; 5int CLK 6 = 10; 7 8byte a[8]= {0x00,0xE9,0x89,0xE9,0x29,0xEF,0x00,0x00,}; 9byte 10 b[8]= {0x00,0xE7,0x94,0xE7,0x91,0xE7,0x00,0x00,}; 11byte c[8]= {0x00,0xEC,0x8A,0x8C,0x8A,0xEA,0x00,0x00,}; 12byte 13 d[8]= {0x00,0xEE,0x49,0x4E,0x49,0xEE,0x00,0x00,}; 14byte e[8]= {0x00,0xF0,0x80,0xF0,0x80,0xF0,0x00,0x00,}; 15 16 17LedControl 18 lc=LedControl(DIN,CLK,CS,0); 19 20void setup(){ 21 lc.shutdown(0,false); //The 22 MAX72XX is in power-saving mode on startup 23 lc.setIntensity(0,15); // Set 24 the brightness to maximum value 25 lc.clearDisplay(0); // and clear the 26 display 27} 28 29void loop(){ 30 31 byte f[8]= {0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,}; 32 33 byte g[8]= {0xFF,0x99,0x00,0x00,0x81,0xC3,0xE7,0xFF,}; 34 byte h[8]= {0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00,}; 35 36 byte i[8] = {0xFF,0x99,0x00,0x00,0x81,0xC3,0xE7,0xFF,}; 37 38 printByte(f); 39 40 41 delay(1000); 42 43 printByte(g); 44 45 delay(1000); 46 47 48 printByte(h); 49 50 delay(1000); 51 52 printByte(i); 53 54 delay(1000); 55 56 57 printEduc8s(); 58 59 lc.clearDisplay(0); 60 61 delay(1000); 62} 63 64void 65 printEduc8s() 66{ 67 printByte(a); 68 delay(1000); 69 printByte(b); 70 delay(1000); 71 72 printByte(c); 73 delay(1000); 74 printByte(d); 75 delay(1000); 76 printByte(e); 77 78 delay(1000); 79 80 81} 82 83void printByte(byte character []) 84{ 85 86 int i = 0; 87 for(i=0;i<8;i++) 88 { 89 lc.setRow(0,i,character[i]); 90 91 } 92} 93
Downloadable files
ledmatrix_bb_6mCJPj6nfz.png
ledmatrix_bb_6mCJPj6nfz.png
Comments
Only logged in users can leave comments
Anonymous user
4 years ago
Hi, This looks great but I can't get it to run. I get an error saying : Exit status l, 'lc' was not declared. Is there another driver or something I need to include?