After the study number two #define COM_HEAR 2 #define COM_SOUND 3 #define Com_speak 4 void Setup () {Pinmode (Com_sound, OUTPUT);
Pinmode (Com_speak, OUTPUT);
Pinmode (Com_hear, INPUT);
Serial.begin (9600);
} void Loop () {int I, j, K;
int hear_sta[12] = {0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0};
int speak[12] = {0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1};
int hear[12] = {0};
i = 0;
int judge = 0;
int count = 0; while (judge! = 1)//{for (k = 0; k <, k++) {if (speak[k] = = 0) {for (i = 0; i <) i+
+) {digitalwrite (com_speak, high);
Delaymicroseconds (13);
Digitalwrite (Com_speak, low);
Delaymicroseconds (13);
}} else if (speak[k] = = 1) {Digitalwrite (com_speak, low);
Delaymicroseconds (1100);
}} for (i = 0; i < i++) {hear[0] = Digitalread (com_hear);
Delaymicroseconds (550); if (hear[0] = = 0) {for (j = 1; J <; J + +) {DelaymicrosecoNDS (1100);
HEAR[J] = Digitalread (com_hear);
} for (j = 0; J <, J + +) {if (hear[j] = = Hear_sta[j]) count++; } if (count = =) {for (int x = 0; x < +) {Digitalwrite (com_sound), HIG
H);
Delaymicroseconds (250);
Digitalwrite (Com_sound, low);
Delaymicroseconds (250);
}}} delaymicroseconds (100);
Count = 0;
} for (i = 0; i < i++) Serial.print (Hear[i]);
Serial.println (); }