Components and supplies
Male/Female Jumper Wires
8x8 LED Matrix
Arduino Mega 2560
Apps and platforms
Arduino IDE
Project description
Code
8x8Matrix_LED.ino
arduino
1#include <LedControl.h> 2 3int DIN = 10; 4int CS = 9; 5int CLK = 8; 6 7//Main 8byte Design1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 9byte Design2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,}; 10byte Design3[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,}; 11byte Design4[8]= {0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,}; 12byte Design5[8]= {0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,}; 13byte Design6[8]= {0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,}; 14byte Design7[8]= {0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,}; 15byte Design8[8]= {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,}; 16byte Design9[8]= {0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,}; 17byte Design10[8]= {0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,}; 18byte Design11[8]= {0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,}; 19byte Design12[8]= {0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,}; 20byte Design13[8]= {0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,}; 21byte Design14[8]= {0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 22byte Design15[8]= {0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 23byte Design16[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 24byte Design17[8]= {0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 25byte Design18[8]= {0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,}; 26byte Design19[8]= {0xAB,0x57,0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,}; 27byte Design20[8]= {0xAA,0x55,0xAB,0x57,0xAF,0x5F,0xBF,0x7F,}; 28byte Design21[8]= {0xAA,0x55,0xAA,0x55,0xAB,0x57,0xAF,0x5F,}; 29byte Design22[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAB,0x57,}; 30byte Design23[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,}; 31 32 33//Blink 34byte BlinkOn1[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 35byte BlinkOff1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 36byte BlinkOn2[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,}; 37byte BlinkOff2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 38 39 40 41 42LedControl lc=LedControl(DIN,CLK,CS,0); 43 44void setup(){ 45 lc.shutdown(0,false); //The MAX72XX is in power-saving mode on startup 46 lc.setIntensity(0,15); // Set the brightness to maximum value 47 lc.clearDisplay(0); // and clear the display 48} 49 50void loop(){ 51 52 53 54 printByte(Design1); 55 56 delay(100); 57 58printByte(Design2); 59 60 delay(100); 61 62printByte(Design3); 63 64 delay(100); 65 66printByte(Design4); 67 68 delay(100); 69 70printByte(Design5); 71 72 delay(100); 73 74printByte(Design6); 75 76 delay(100); 77 78printByte(Design7); 79 80 delay(100); 81 82printByte(Design8); 83 84 delay(100); 85 86printByte(Design9); 87 88 delay(100); 89 90printByte(Design10); 91 92 delay(100); 93 94printByte(Design11); 95 96 delay(100); 97 98printByte(Design12); 99 100 delay(100); 101 102printByte(Design13); 103 104 delay(100); 105 106printByte(Design14); 107 108 delay(100); 109 110printByte(Design15); 111 112 delay(100); 113 114printByte(Design16); 115 116 delay(100); 117 118 119 120//Blink1 121 122printByte(BlinkOn1); 123 124delay(750); 125 126printByte(BlinkOff1); 127 128delay(750); 129 130printByte(BlinkOn1); 131 132delay(750); 133 134printByte(BlinkOff1); 135 136delay(750); 137 138printByte(BlinkOn1); 139 140delay(750); 141 142//Design2 143 144printByte(Design17); 145 146delay(100); 147 148printByte(Design18); 149 150delay(100); 151 152printByte(Design19); 153 154delay(100); 155 156printByte(Design20); 157 158delay(100); 159 160printByte(Design21); 161 162delay(100); 163 164printByte(Design22); 165 166delay(100); 167 168printByte(Design23); 169 170delay(100); 171 172//Blink2 173 174printByte(BlinkOn2); 175 176delay(750); 177 178printByte(BlinkOff2); 179 180delay(750); 181 182printByte(BlinkOn2); 183 184delay(750); 185 186printByte(BlinkOff2); 187 188delay(750); 189 190 191} 192 193 194void printByte(byte character []) 195{ 196 int i = 0; 197 for(i=0;i<8;i++) 198 { 199 lc.setRow(0,i,character[i]); 200 } 201} 202
8x8Matrix_LED.ino
arduino
1#include <LedControl.h> 2 3int DIN = 10; 4int CS = 9; 5int CLK 6 = 8; 7 8//Main 9byte Design1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 10byte 11 Design2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,}; 12byte Design3[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,}; 13byte 14 Design4[8]= {0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,}; 15byte Design5[8]= {0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,}; 16byte 17 Design6[8]= {0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,}; 18byte Design7[8]= {0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,}; 19byte 20 Design8[8]= {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,}; 21byte Design9[8]= {0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,}; 22byte 23 Design10[8]= {0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,}; 24byte Design11[8]= {0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,}; 25byte 26 Design12[8]= {0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,}; 27byte Design13[8]= {0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,}; 28byte 29 Design14[8]= {0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 30byte Design15[8]= {0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 31byte 32 Design16[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 33byte Design17[8]= {0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 34byte 35 Design18[8]= {0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,}; 36byte Design19[8]= {0xAB,0x57,0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,}; 37byte 38 Design20[8]= {0xAA,0x55,0xAB,0x57,0xAF,0x5F,0xBF,0x7F,}; 39byte Design21[8]= {0xAA,0x55,0xAA,0x55,0xAB,0x57,0xAF,0x5F,}; 40byte 41 Design22[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAB,0x57,}; 42byte Design23[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,}; 43 44 45//Blink 46byte 47 BlinkOn1[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,}; 48byte BlinkOff1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 49byte 50 BlinkOn2[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,}; 51byte BlinkOff2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; 52 53 54 55 56LedControl 57 lc=LedControl(DIN,CLK,CS,0); 58 59void setup(){ 60 lc.shutdown(0,false); //The 61 MAX72XX is in power-saving mode on startup 62 lc.setIntensity(0,15); // Set 63 the brightness to maximum value 64 lc.clearDisplay(0); // and clear the 65 display 66} 67 68void loop(){ 69 70 71 72 printByte(Design1); 73 74 75 delay(100); 76 77printByte(Design2); 78 79 delay(100); 80 81printByte(Design3); 82 83 84 delay(100); 85 86printByte(Design4); 87 88 delay(100); 89 90printByte(Design5); 91 92 93 delay(100); 94 95printByte(Design6); 96 97 delay(100); 98 99printByte(Design7); 100 101 102 delay(100); 103 104printByte(Design8); 105 106 delay(100); 107 108printByte(Design9); 109 110 111 delay(100); 112 113printByte(Design10); 114 115 delay(100); 116 117printByte(Design11); 118 119 120 delay(100); 121 122printByte(Design12); 123 124 delay(100); 125 126printByte(Design13); 127 128 129 delay(100); 130 131printByte(Design14); 132 133 delay(100); 134 135printByte(Design15); 136 137 138 delay(100); 139 140printByte(Design16); 141 142 delay(100); 143 144 145 146//Blink1 147 148 149printByte(BlinkOn1); 150 151delay(750); 152 153printByte(BlinkOff1); 154 155delay(750); 156 157printByte(BlinkOn1); 158 159delay(750); 160 161printByte(BlinkOff1); 162 163delay(750); 164 165printByte(BlinkOn1); 166 167delay(750); 168 169//Design2 170 171printByte(Design17); 172 173delay(100); 174 175printByte(Design18); 176 177delay(100); 178 179printByte(Design19); 180 181delay(100); 182 183printByte(Design20); 184 185delay(100); 186 187printByte(Design21); 188 189delay(100); 190 191printByte(Design22); 192 193delay(100); 194 195printByte(Design23); 196 197delay(100); 198 199//Blink2 200 201printByte(BlinkOn2); 202 203delay(750); 204 205printByte(BlinkOff2); 206 207delay(750); 208 209printByte(BlinkOn2); 210 211delay(750); 212 213printByte(BlinkOff2); 214 215delay(750); 216 217 218} 219 220 221void 222 printByte(byte character []) 223{ 224 int i = 0; 225 for(i=0;i<8;i++) 226 { 227 228 lc.setRow(0,i,character[i]); 229 } 230} 231
Downloadable files
led_8x8_matrix_demo_hUdxz3xWri.png
led_8x8_matrix_demo_hUdxz3xWri.png
Comments
Only logged in users can leave comments