1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
voice_recogn_8x32 dot matrix
¾Æ·¡ ¸µÅ©¿¡¼­ LedControl ¶óÀ̺귯¸®¸¦ ´Ù¿î·Îµå
https://github.com/wayoda/LedControl
www.mcuboard.com
*/
 
 
#include "LedControl.h" // ¶óÀ̺귯¸® »ç¿ë ¼±¾ð
#include <SoftwareSerial.h> // ¼ÒÇÁÆ®¿þ¾î Serial Åë½ÅÀ» Çϱâ À§ÇØ ¶óÀ̺귯¸® »ç¿ë
 
// Serial Åë½ÅÇÉÀ¸·Î D11¹øÇÉÀ» Rx·Î, D10¹øÇÉÀ» Tx·Î ¼±¾ð
SoftwareSerial mySerial(23); // ¸ðµâ TX=11¹øÇÉ , RX=10¹øÇÉ ¿¬°á
 
// Din ÇÉÀ» 12¹ø, ClKÇÉÀ» 11¹ø CSÇÉÀ» 10¹ø¿¡ ¿¬°á, ¸ÅÆ®¸¯½º´Â 1°³¸¦ »ç¿ë ¼±¾ð
LedControl lc=LedControl(12,11,10,1);
int voice_recogn=0;
 
byte data[5][8]=
{
    // ¹«Ç¥Á¤ À̹ÌÁö
             {
             B11111111,
             B10000001,
             B10100101,
             B10000001,
             B10000001,
             B10111101,
             B10000001,
             B11111111
             },
  // ¿ô´Â Ç¥Á¤ À̹ÌÁö
             {
             B11111111,
             B10000001,
             B10100101,
             B10000001,
             B10100101,
             B10111101,
             B10000001,
             B11111111
             },
  // ½ÊÀÚ°¡ ¸ð¾ç
             { 
             B00011000,
             B00011000,
             B00011000,
             B11111111,
             B11111111,
             B00011000,
             B00011000,
             B00011000
             },
  // ÇÏÆ® ¸ð¾ç
             {
             B00000000,
             B01100110,
             B11111111,
             B11111111,
             B11111111,
             B01111110,
             B00111100,
             B00011000
             },
  // µ¿±×¶õ ¿ô´Â¸ð¾ç             
             {
             B00111100,
             B01000010,
             B10100101,
             B10000001,
             B10100101,
             B10011001,
             B01000010,
             B00111100
             }
};
 
void setup()
{
   Serial.begin(9600); // Åë½Å ¼Óµµ 9600bps·Î PC¿Í ½Ã¸®¾ó Åë½Å ½ÃÀÛ
   mySerial.begin(9600); // Åë½Å ¼Óµµ 9600bps·Î ¸ðµâ°ú ½Ã¸®¾ó Åë½Å ½ÃÀÛ
   lc.shutdown(0,false); // 0~3¹ø±îÁö ¸ÅÆ®¸¯½º ÀýÀü¸ðµå ÇØÁ¦
   lc.setIntensity(0,8); // ¸ÅÆ®¸¯½ºÀÇ ¹à±â ¼±¾ð 0~15ÀÇ ¼ö
   lc.clearDisplay(0); // ¸ÅÆ®¸¯½º led¸¦ ÃʱâÈ­
 
   Serial.println("wait settings are in progress");
   delay(1000);
   mySerial.write(0xAA); // compact mode »ç¿ë 
   mySerial.write(0x37); 
   delay(1000);
   mySerial.write(0xAA); // ±×·ì1 À½¼º ¸í·É¾î imported
   mySerial.write(0x21);
    
   Serial.println("The settings are complete");
}
 
void loop() 
{
  while(mySerial.available()) 
  {
    Serial.println("voice input");
    voice_recogn=mySerial.read();
 
    switch(voice_recogn) 
    {
      case 0x11:
      for(int j=0; j<8; j++)
       {
        lc.setRow(0,j,data[0][j]); // ¹«Ç¥Á¤ À̹ÌÁö Ãâ·Â
       }
      Serial.println("¹«Ç¥Á¤ À̹ÌÁö Ãâ·Â");
 
       break;
       
      case 0x12:
      for(int j=0; j<8; j++)
       {
        lc.setRow(0,j,data[1][j]); // ¿ô´Â Ç¥Á¤ À̹ÌÁö Ãâ·Â
       }
       Serial.println("¿ô´Â Ç¥Á¤ À̹ÌÁö Ãâ·Â");
 
       break;
 
      case 0x13:
      for(int j=0; j<8; j++)
       {
        lc.setRow(0,j,data[2][j]); // ½ÊÀÚ°¡ ¸ð¾ç À̹ÌÁö Ãâ·Â
       }
       Serial.println("½ÊÀÚ°¡ ¸ð¾ç À̹ÌÁö Ãâ·Â");
 
       break;
       
      case 0x14:
      for(int j=0; j<8; j++)
       {
        lc.setRow(0,j,data[3][j]); // ÇÏÆ® ¸ð¾ç À̹ÌÁö Ãâ·Â
       }
       Serial.println("ÇÏÆ® ¸ð¾ç À̹ÌÁö Ãâ·Â");
 
       break;  
            
      case 0x15:
      for(int j=0; j<8; j++)
       {
        lc.setRow(0,j,data[4][j]); // µ¿±×¶õ ¿ô´Â Ç¥Á¤ À̹ÌÁöÃâ·Â
       }
       Serial.println("µ¿±Û ¿ô´Â À̹ÌÁö Ãâ·Â");
 
       break;
   }
  }
}
cs