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);
18 lc.setIntensity(0,15);
19 lc.clearDisplay(0);
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
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?