Components and supplies
Through Hole Resistor, 330 ohm
LED Dot Matrix Display, Red
Arduino Nano R3
Project description
Code
Testing all 64 LED of the 8x8 LED matrix
arduino
1// Mario's Ideas 2// Testing all 64 leds in 8x8 LED matrix by lighting them up one by one 3 4// Raws 5#define R1 2 6#define R2 3 7#define R3 4 8#define R4 5 9#define R5 6 10#define R6 7 11#define R7 8 12#define R8 9 13//Columns 14#define C1 10 15#define C2 11 16#define C3 12 17#define C4 13 18#define C5 A0 19#define C6 A1 20#define C7 A2 21#define C8 A3 22 23 24 25void setup() { 26 pinMode(R1, OUTPUT); 27 pinMode(R2, OUTPUT); 28 pinMode(R3, OUTPUT); 29 pinMode(R4, OUTPUT); 30 pinMode(R5, OUTPUT); 31 pinMode(R6, OUTPUT); 32 pinMode(R7, OUTPUT); 33 pinMode(R8, OUTPUT); 34 pinMode(C1, OUTPUT); 35 pinMode(C2, OUTPUT); 36 pinMode(C3, OUTPUT); 37 pinMode(C4, OUTPUT); 38 pinMode(C5, OUTPUT); 39 pinMode(C6, OUTPUT); 40 pinMode(C7, OUTPUT); 41 pinMode(C8, OUTPUT); 42// Turning all the LEDs off at the start of the sketch 43 digitalWrite(R1,HIGH); 44 digitalWrite(R2,HIGH); 45 digitalWrite(R3,HIGH); 46 digitalWrite(R4,HIGH); 47 digitalWrite(R5,HIGH); 48 digitalWrite(R6,HIGH); 49 digitalWrite(R7,HIGH); 50 digitalWrite(R8,HIGH); 51 digitalWrite(C1,LOW); 52 digitalWrite(C2,LOW); 53 digitalWrite(C3,LOW); 54 digitalWrite(C4,LOW); 55 digitalWrite(C5,LOW); 56 digitalWrite(C6,LOW); 57 digitalWrite(C7,LOW); 58 digitalWrite(C8,LOW); 59} 60 61 62 63void SelectRow(int row){ 64 if (row==1) digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 65 if (row==2) digitalWrite(R2,LOW); else digitalWrite(R2,HIGH); 66 if (row==3) digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 67 if (row==4) digitalWrite(R4,LOW); else digitalWrite(R4,HIGH); 68 if (row==5) digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 69 if (row==6) digitalWrite(R6,LOW); else digitalWrite(R6,HIGH); 70 if (row==7) digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 71 if (row==8) digitalWrite(R8,LOW); else digitalWrite(R8,HIGH); 72} 73 74void SelectColumn(int column){ 75 if (column==1) digitalWrite(C1,HIGH); else digitalWrite(C1,LOW); 76 if (column==2) digitalWrite(C2,HIGH); else digitalWrite(C2,LOW); 77 if (column==3) digitalWrite(C3,HIGH); else digitalWrite(C3,LOW); 78 if (column==4) digitalWrite(C4,HIGH); else digitalWrite(C4,LOW); 79 if (column==5) digitalWrite(C5,HIGH); else digitalWrite(C5,LOW); 80 if (column==6) digitalWrite(C6,HIGH); else digitalWrite(C6,LOW); 81 if (column==7) digitalWrite(C7,HIGH); else digitalWrite(C7,LOW); 82 if (column==8) digitalWrite(C8,HIGH); else digitalWrite(C8,LOW); 83 84} 85 86 87void loop() { 88 for (int i=1;i<9;i++) { 89 for (int j=1;j<9;j++){ 90 SelectRow(i); 91 SelectColumn(j); 92 delay(100); 93 } 94 } 95}
Scrolling text on 8x8 LED matrix (Multiplexing)
arduino
1// Mario's Ideas 2// Scrolling text on 8x8 LED matrix (Multiplexing) 3 4// Raws 5#define R1 2 6#define R2 3 7#define R3 4 8#define R4 5 9#define R5 6 10#define R6 7 11#define R7 8 12#define R8 9 13//Columns 14#define C1 10 15#define C2 11 16#define C3 12 17#define C4 13 18#define C5 A0 19#define C6 A1 20#define C7 A2 21#define C8 A3 22 23int position=0; 24 25 int Marios_ideas [8] [54] ={ 26 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 27 {0,1,0,0,0,1,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0}, 28 {0,1,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0}, 29 {0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0}, 30 {0,1,0,0,0,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,0,1,0,1,1,1,0,1,1,1,1,0,0,1,1,0,0,0,0}, 31 {0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0}, 32 {0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,1,0,0, 1,0,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0}, 33 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0} 34 }; 35 36void setup() { 37 pinMode(R1, OUTPUT); 38 pinMode(R2, OUTPUT); 39 pinMode(R3, OUTPUT); 40 pinMode(R4, OUTPUT); 41 pinMode(R5, OUTPUT); 42 pinMode(R6, OUTPUT); 43 pinMode(R7, OUTPUT); 44 pinMode(R8, OUTPUT); 45 pinMode(C1, OUTPUT); 46 pinMode(C2, OUTPUT); 47 pinMode(C3, OUTPUT); 48 pinMode(C4, OUTPUT); 49 pinMode(C5, OUTPUT); 50 pinMode(C6, OUTPUT); 51 pinMode(C7, OUTPUT); 52 pinMode(C8, OUTPUT); 53 54 digitalWrite(R1,HIGH); 55 digitalWrite(R2,HIGH); 56 digitalWrite(R3,HIGH); 57 digitalWrite(R4,HIGH); 58 digitalWrite(R5,HIGH); 59 digitalWrite(R6,HIGH); 60 digitalWrite(R7,HIGH); 61 digitalWrite(R8,HIGH); 62 digitalWrite(C1,LOW); 63 digitalWrite(C2,LOW); 64 digitalWrite(C3,LOW); 65 digitalWrite(C4,LOW); 66 digitalWrite(C5,LOW); 67 digitalWrite(C6,LOW); 68 digitalWrite(C7,LOW); 69 digitalWrite(C8,LOW); 70} 71 72 73 74void SelectRow(int row){ 75 if (row==1) digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 76 if (row==2) digitalWrite(R2,LOW); else digitalWrite(R2,HIGH); 77 if (row==3) digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 78 if (row==4) digitalWrite(R4,LOW); else digitalWrite(R4,HIGH); 79 if (row==5) digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 80 if (row==6) digitalWrite(R6,LOW); else digitalWrite(R6,HIGH); 81 if (row==7) digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 82 if (row==8) digitalWrite(R8,LOW); else digitalWrite(R8,HIGH); 83} 84 85void Set_LED_in_Active_Row(int column, int state){ 86 if (column==1) digitalWrite(C1,state); 87 if (column==2) digitalWrite(C2,state); 88 if (column==3) digitalWrite(C3,state); 89 if (column==4) digitalWrite(C4,state); 90 if (column==5) digitalWrite(C5,state); 91 if (column==6) digitalWrite(C6,state); 92 if (column==7) digitalWrite(C7,state); 93 if (column==8) digitalWrite(C8,state); 94} 95 96void loop() { 97 98 for (int x=0; x<5;x++){ 99 for (int j=0;j<8;j++){ 100 SelectRow(j+1); 101 for (int i=0;i<8;i++){ 102 Set_LED_in_Active_Row(i+1,Marios_ideas[j][(i+position)-abs((i+position)/54)*54]); 103 } 104 delay(2); 105 } 106 } 107 position=position+1; 108}
Displaying cat image on 8x8 LED Matrix (Multiplexing)
arduino
1// Mario's ideas 2// Displaying cat image on 8x8 LED Matrix (Multiplexing) 3 4// Raws 5#define R1 2 6#define R2 3 7#define R3 4 8#define R4 5 9#define R5 6 10#define R6 7 11#define R7 8 12#define R8 9 13//Columns 14#define C1 10 15#define C2 11 16#define C3 12 17#define C4 13 18#define C5 A0 19#define C6 A1 20#define C7 A2 21#define C8 A3 22 23int pause=300; 24 25 26 int Cat [8] [8] ={ 27 {1,0,0,0,1,0,0,0}, 28 {1,1,1,1,1,0,0,0}, 29 {1,0,1,0,1,0,0,0}, 30 {0,1,1,1,0,0,0,1}, 31 {0,0,1,0,0,0,0,1}, 32 {0,1,1,1,1,0,0,1}, 33 {0,1,1,1,1,1,0,1}, 34 {1,0,1,1,1,1,1,0}, 35 }; 36 37void setup() { 38 pinMode(R1, OUTPUT); 39 pinMode(R2, OUTPUT); 40 pinMode(R3, OUTPUT); 41 pinMode(R4, OUTPUT); 42 pinMode(R5, OUTPUT); 43 pinMode(R6, OUTPUT); 44 pinMode(R7, OUTPUT); 45 pinMode(R8, OUTPUT); 46 pinMode(C1, OUTPUT); 47 pinMode(C2, OUTPUT); 48 pinMode(C3, OUTPUT); 49 pinMode(C4, OUTPUT); 50 pinMode(C5, OUTPUT); 51 pinMode(C6, OUTPUT); 52 pinMode(C7, OUTPUT); 53 pinMode(C8, OUTPUT); 54 55 digitalWrite(R1,HIGH); 56 digitalWrite(R2,HIGH); 57 digitalWrite(R3,HIGH); 58 digitalWrite(R4,HIGH); 59 digitalWrite(R5,HIGH); 60 digitalWrite(R6,HIGH); 61 digitalWrite(R7,HIGH); 62 digitalWrite(R8,HIGH); 63 digitalWrite(C1,LOW); 64 digitalWrite(C2,LOW); 65 digitalWrite(C3,LOW); 66 digitalWrite(C4,LOW); 67 digitalWrite(C5,LOW); 68 digitalWrite(C6,LOW); 69 digitalWrite(C7,LOW); 70 digitalWrite(C8,LOW); 71} 72 73 74 75void SelectRow(int row){ 76 if (row==1) digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 77 if (row==2) digitalWrite(R2,LOW); else digitalWrite(R2,HIGH); 78 if (row==3) digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 79 if (row==4) digitalWrite(R4,LOW); else digitalWrite(R4,HIGH); 80 if (row==5) digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 81 if (row==6) digitalWrite(R6,LOW); else digitalWrite(R6,HIGH); 82 if (row==7) digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 83 if (row==8) digitalWrite(R8,LOW); else digitalWrite(R8,HIGH); 84} 85 86void Set_LED_in_Active_Row(int column, int state){ 87 if (column==1) digitalWrite(C1,state); 88 if (column==2) digitalWrite(C2,state); 89 if (column==3) digitalWrite(C3,state); 90 if (column==4) digitalWrite(C4,state); 91 if (column==5) digitalWrite(C5,state); 92 if (column==6) digitalWrite(C6,state); 93 if (column==7) digitalWrite(C7,state); 94 if (column==8) digitalWrite(C8,state); 95} 96 97void loop() { 98 99 100 for (int j=0;j<8;j++){ 101 SelectRow(j+1); 102 for (int i=0;i<8;i++){ 103 Set_LED_in_Active_Row(i+1 ,Cat[j][i]); 104 } 105 delay(2+pause); 106 } 107if(pause!=0 and pause>100)pause=pause-100; 108if(pause!=0 and pause<=100)pause=pause-10; 109} 110
Testing all 64 LED of the 8x8 LED matrix
arduino
1// Mario's Ideas 2// Testing all 64 leds in 8x8 LED matrix by lighting 3 them up one by one 4 5// Raws 6#define R1 2 7#define R2 3 8#define R3 9 4 10#define R4 5 11#define R5 6 12#define R6 7 13#define R7 8 14#define R8 15 9 16//Columns 17#define C1 10 18#define C2 11 19#define C3 12 20#define C4 21 13 22#define C5 A0 23#define C6 A1 24#define C7 A2 25#define C8 A3 26 27 28 29void 30 setup() { 31 pinMode(R1, OUTPUT); 32 pinMode(R2, OUTPUT); 33 pinMode(R3, 34 OUTPUT); 35 pinMode(R4, OUTPUT); 36 pinMode(R5, OUTPUT); 37 pinMode(R6, 38 OUTPUT); 39 pinMode(R7, OUTPUT); 40 pinMode(R8, OUTPUT); 41 pinMode(C1, 42 OUTPUT); 43 pinMode(C2, OUTPUT); 44 pinMode(C3, OUTPUT); 45 pinMode(C4, 46 OUTPUT); 47 pinMode(C5, OUTPUT); 48 pinMode(C6, OUTPUT); 49 pinMode(C7, 50 OUTPUT); 51 pinMode(C8, OUTPUT); 52// Turning all the LEDs off at the start 53 of the sketch 54 digitalWrite(R1,HIGH); 55 digitalWrite(R2,HIGH); 56 digitalWrite(R3,HIGH); 57 58 digitalWrite(R4,HIGH); 59 digitalWrite(R5,HIGH); 60 digitalWrite(R6,HIGH); 61 62 digitalWrite(R7,HIGH); 63 digitalWrite(R8,HIGH); 64 digitalWrite(C1,LOW); 65 66 digitalWrite(C2,LOW); 67 digitalWrite(C3,LOW); 68 digitalWrite(C4,LOW); 69 70 digitalWrite(C5,LOW); 71 digitalWrite(C6,LOW); 72 digitalWrite(C7,LOW); 73 74 digitalWrite(C8,LOW); 75} 76 77 78 79void SelectRow(int row){ 80 if (row==1) 81 digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 82 if (row==2) digitalWrite(R2,LOW); 83 else digitalWrite(R2,HIGH); 84 if (row==3) digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 85 86 if (row==4) digitalWrite(R4,LOW); else digitalWrite(R4,HIGH); 87 if (row==5) 88 digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 89 if (row==6) digitalWrite(R6,LOW); 90 else digitalWrite(R6,HIGH); 91 if (row==7) digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 92 93 if (row==8) digitalWrite(R8,LOW); else digitalWrite(R8,HIGH); 94} 95 96void 97 SelectColumn(int column){ 98 if (column==1) digitalWrite(C1,HIGH); else digitalWrite(C1,LOW); 99 100 if (column==2) digitalWrite(C2,HIGH); else digitalWrite(C2,LOW); 101 if (column==3) 102 digitalWrite(C3,HIGH); else digitalWrite(C3,LOW); 103 if (column==4) digitalWrite(C4,HIGH); 104 else digitalWrite(C4,LOW); 105 if (column==5) digitalWrite(C5,HIGH); else digitalWrite(C5,LOW); 106 107 if (column==6) digitalWrite(C6,HIGH); else digitalWrite(C6,LOW); 108 if (column==7) 109 digitalWrite(C7,HIGH); else digitalWrite(C7,LOW); 110 if (column==8) digitalWrite(C8,HIGH); 111 else digitalWrite(C8,LOW); 112 113} 114 115 116void loop() { 117 for (int i=1;i<9;i++) 118 { 119 for (int j=1;j<9;j++){ 120 SelectRow(i); 121 SelectColumn(j); 122 123 delay(100); 124 } 125 } 126}
Scrolling text on 8x8 LED matrix (Multiplexing)
arduino
1// Mario's Ideas 2// Scrolling text on 8x8 LED matrix (Multiplexing) 3 4// 5 Raws 6#define R1 2 7#define R2 3 8#define R3 4 9#define R4 5 10#define 11 R5 6 12#define R6 7 13#define R7 8 14#define R8 9 15//Columns 16#define C1 17 10 18#define C2 11 19#define C3 12 20#define C4 13 21#define C5 A0 22#define 23 C6 A1 24#define C7 A2 25#define C8 A3 26 27int position=0; 28 29 int Marios_ideas 30 [8] [54] ={ 31 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, 32 33 {0,1,0,0,0,1,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0}, 34 35 {0,1,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0}, 36 37 {0,1,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0}, 38 39 {0,1,0,0,0,1,0,1,1,1,1,0,1,1,1,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,1,0,1,0,0,1,0,1,1,1,0,1,1,1,1,0,0,1,1,0,0,0,0}, 40 41 {0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0}, 42 43 {0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,0,0,1,0,0, 1,0,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0}, 44 45 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0} 46 47 }; 48 49void setup() { 50 pinMode(R1, OUTPUT); 51 pinMode(R2, OUTPUT); 52 53 pinMode(R3, OUTPUT); 54 pinMode(R4, OUTPUT); 55 pinMode(R5, OUTPUT); 56 57 pinMode(R6, OUTPUT); 58 pinMode(R7, OUTPUT); 59 pinMode(R8, OUTPUT); 60 61 pinMode(C1, OUTPUT); 62 pinMode(C2, OUTPUT); 63 pinMode(C3, OUTPUT); 64 65 pinMode(C4, OUTPUT); 66 pinMode(C5, OUTPUT); 67 pinMode(C6, OUTPUT); 68 69 pinMode(C7, OUTPUT); 70 pinMode(C8, OUTPUT); 71 72 digitalWrite(R1,HIGH); 73 74 digitalWrite(R2,HIGH); 75 digitalWrite(R3,HIGH); 76 digitalWrite(R4,HIGH); 77 78 digitalWrite(R5,HIGH); 79 digitalWrite(R6,HIGH); 80 digitalWrite(R7,HIGH); 81 82 digitalWrite(R8,HIGH); 83 digitalWrite(C1,LOW); 84 digitalWrite(C2,LOW); 85 86 digitalWrite(C3,LOW); 87 digitalWrite(C4,LOW); 88 digitalWrite(C5,LOW); 89 90 digitalWrite(C6,LOW); 91 digitalWrite(C7,LOW); 92 digitalWrite(C8,LOW); 93} 94 95 96 97void 98 SelectRow(int row){ 99 if (row==1) digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 100 101 if (row==2) digitalWrite(R2,LOW); else digitalWrite(R2,HIGH); 102 if (row==3) 103 digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 104 if (row==4) digitalWrite(R4,LOW); 105 else digitalWrite(R4,HIGH); 106 if (row==5) digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 107 108 if (row==6) digitalWrite(R6,LOW); else digitalWrite(R6,HIGH); 109 if (row==7) 110 digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 111 if (row==8) digitalWrite(R8,LOW); 112 else digitalWrite(R8,HIGH); 113} 114 115void Set_LED_in_Active_Row(int column, int 116 state){ 117 if (column==1) digitalWrite(C1,state); 118 if (column==2) digitalWrite(C2,state); 119 120 if (column==3) digitalWrite(C3,state); 121 if (column==4) digitalWrite(C4,state); 122 123 if (column==5) digitalWrite(C5,state); 124 if (column==6) digitalWrite(C6,state); 125 126 if (column==7) digitalWrite(C7,state); 127 if (column==8) digitalWrite(C8,state); 128 129} 130 131void loop() { 132 133 for (int x=0; x<5;x++){ 134 for (int j=0;j<8;j++){ 135 136 SelectRow(j+1); 137 for (int i=0;i<8;i++){ 138 Set_LED_in_Active_Row(i+1,Marios_ideas[j][(i+position)-abs((i+position)/54)*54]); 139 140 } 141 delay(2); 142 } 143 } 144 position=position+1; 145}
Displaying cat image on 8x8 LED Matrix (Multiplexing)
arduino
1// Mario's ideas 2// Displaying cat image on 8x8 LED Matrix (Multiplexing) 3 4// 5 Raws 6#define R1 2 7#define R2 3 8#define R3 4 9#define R4 5 10#define 11 R5 6 12#define R6 7 13#define R7 8 14#define R8 9 15//Columns 16#define C1 17 10 18#define C2 11 19#define C3 12 20#define C4 13 21#define C5 A0 22#define 23 C6 A1 24#define C7 A2 25#define C8 A3 26 27int pause=300; 28 29 30 int Cat 31 [8] [8] ={ 32 {1,0,0,0,1,0,0,0}, 33 {1,1,1,1,1,0,0,0}, 34 {1,0,1,0,1,0,0,0}, 35 36 {0,1,1,1,0,0,0,1}, 37 {0,0,1,0,0,0,0,1}, 38 {0,1,1,1,1,0,0,1}, 39 {0,1,1,1,1,1,0,1}, 40 41 {1,0,1,1,1,1,1,0}, 42 }; 43 44void setup() { 45 pinMode(R1, OUTPUT); 46 47 pinMode(R2, OUTPUT); 48 pinMode(R3, OUTPUT); 49 pinMode(R4, OUTPUT); 50 51 pinMode(R5, OUTPUT); 52 pinMode(R6, OUTPUT); 53 pinMode(R7, OUTPUT); 54 55 pinMode(R8, OUTPUT); 56 pinMode(C1, OUTPUT); 57 pinMode(C2, OUTPUT); 58 59 pinMode(C3, OUTPUT); 60 pinMode(C4, OUTPUT); 61 pinMode(C5, OUTPUT); 62 63 pinMode(C6, OUTPUT); 64 pinMode(C7, OUTPUT); 65 pinMode(C8, OUTPUT); 66 67 68 digitalWrite(R1,HIGH); 69 digitalWrite(R2,HIGH); 70 digitalWrite(R3,HIGH); 71 72 digitalWrite(R4,HIGH); 73 digitalWrite(R5,HIGH); 74 digitalWrite(R6,HIGH); 75 76 digitalWrite(R7,HIGH); 77 digitalWrite(R8,HIGH); 78 digitalWrite(C1,LOW); 79 80 digitalWrite(C2,LOW); 81 digitalWrite(C3,LOW); 82 digitalWrite(C4,LOW); 83 84 digitalWrite(C5,LOW); 85 digitalWrite(C6,LOW); 86 digitalWrite(C7,LOW); 87 88 digitalWrite(C8,LOW); 89} 90 91 92 93void SelectRow(int row){ 94 if (row==1) 95 digitalWrite(R1,LOW); else digitalWrite(R1,HIGH); 96 if (row==2) digitalWrite(R2,LOW); 97 else digitalWrite(R2,HIGH); 98 if (row==3) digitalWrite(R3,LOW); else digitalWrite(R3,HIGH); 99 100 if (row==4) digitalWrite(R4,LOW); else digitalWrite(R4,HIGH); 101 if (row==5) 102 digitalWrite(R5,LOW); else digitalWrite(R5,HIGH); 103 if (row==6) digitalWrite(R6,LOW); 104 else digitalWrite(R6,HIGH); 105 if (row==7) digitalWrite(R7,LOW); else digitalWrite(R7,HIGH); 106 107 if (row==8) digitalWrite(R8,LOW); else digitalWrite(R8,HIGH); 108} 109 110void 111 Set_LED_in_Active_Row(int column, int state){ 112 if (column==1) digitalWrite(C1,state); 113 114 if (column==2) digitalWrite(C2,state); 115 if (column==3) digitalWrite(C3,state); 116 117 if (column==4) digitalWrite(C4,state); 118 if (column==5) digitalWrite(C5,state); 119 120 if (column==6) digitalWrite(C6,state); 121 if (column==7) digitalWrite(C7,state); 122 123 if (column==8) digitalWrite(C8,state); 124} 125 126void loop() { 127 128 129 130 for (int j=0;j<8;j++){ 131 SelectRow(j+1); 132 for (int i=0;i<8;i++){ 133 134 Set_LED_in_Active_Row(i+1 ,Cat[j][i]); 135 } 136 delay(2+pause); 137 138 } 139if(pause!=0 and pause>100)pause=pause-100; 140if(pause!=0 and pause<=100)pause=pause-10; 141} 142
Downloadable files
Connecting 8x8LED Matrix to Arduino
Connecting 8x8LED Matrix to Arduino
Documentation
STL files for Matrix Holder and Diffusion Panel
STL files for Matrix Holder and Diffusion Panel
STL files for Matrix Holder and Diffusion Panel
STL files for Matrix Holder and Diffusion Panel
Comments
Only logged in users can leave comments