//SpeakjetIntro
//by Dana Dietz
//This sketch has been created for use with the SpeakJet IC and the TFT for AtMega
#include <SoftwareSerial.h> //Speakjet needs to act as a serial port
#define rxPin 0 //receive pin 0, old 2
#define txPin 6 //transmission pin 6 on Mega connects to pin 10 on speakjet
#include <TFT_HX8357.h> // Hardware-specific library
#include "Free_Fonts.h" // Include the header file attached to this sketch
TFT_HX8357 tft = TFT_HX8357(); // Invoke custom library
unsigned long drawTime = 0;
/*speakjet has 18 pins
1 = event 7 (E7)/RC1; active low until used //Ground event pins if not used//12
2 = E6/RC0; active low until used //Ground event pins if not used//11
3 = E5; active low until used //Ground event pins if not used/10
4 = E4; active low until used //Ground event pins if not used/9
5 = GND
6 = E3; active low until used //Ground event pins if not used/8
7 = E2; active low until used //Ground event pins if not used/7
8 = E1; active low until used //Ground event pins if not used//5
9 = E0; active low until used //Ground event pins if not used/4
10 = RCX Serial Input (Connect to txPin 1)
11 = Master Reset, Active Low, Reset High/A0
12 = M1 (Baud Configure); V+ thru resistor for normal operation; ground for demo/test mode
13 = M0 (Demo Mode); Ground for normal operation, high for demo
14 = V+ (+2.0 -5.5 Volts DC)
15 = D2/ Buffer Half Full; Data out 2 external; buffer half full internal; active low external (?); active high internal//A1
16 = Data Out 1 (External)/ Speaking Status (Internal); Active high? internal...datasheet omitted info//A2
17 = Data Out 0 (External)/ Ready (internal); default is ready and active high//A3
18 = Voice Output; connect to 2 pole low pass filter followed by an audio amplifier and speaker
*/
//set up pin connections to speakjet
const int E7 = 12;
const int E6 = 11;
const int E5 = 10;
const int E4 = 9;
const int E3 = 8;
const int E2 = 7;
const int E1 = 5;
const int E0 = 4;
const int MR = A0;
const int D2Buf = A1;
const int D1Spk = A2;
const int D0Ready = A3; //active high default
//Create an object serial port for speakjet
SoftwareSerial speakjet = SoftwareSerial(rxPin, txPin);
int TheReadByte = 0;
//The following is from the speakjet library and my own sound interpretation
int phoCode[] = {132, 133, 136, 135, 130, 155, 157, 152, 154, 150, 170, 171, 172, 173, 182, 174, 175, 176, 177, 128, 149, 131,
151, 186, 178, 179, 180, 181, 183, 184, 129, 143, 158, 165, 194, 195, 196, 197, 145, 146, 140, 141, 142, 137,
164, 139, 162, 153, 161, 163, 156, 198, 199, 148, 187, 188, 189, 191, 192, 169, 190, 193, 134, 159, 144, 138,
166, 147, 185, 160, 167, 168, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254
};
//voice sounds 0-71, robot 72-81, alarm 82-91, beeps 92-101, biologic 102-111, DTMF Phone 112-123, Misc 124-126
char* phoSound[] = {"a", "ah", "ah long", "ah short", "ai", "aiy", "aiy", "ar", "ay", "ayr", "b", "b", "b", "b", "ch", "d", "d", "d", "d", "ee", "eer", "eh",
"er", "f", "g", "g", "g", "g", "h", "h", "i", "ing", "iyeh", "j", "k", "k", "k", "k", "l", "lo", "m", "n", "no", "oh",
"oh", "oo", "oo", "or", "ow", "ow", "oy", "p", "p", "r", "s", "s", "sh", "t", "t", "th", "th", "ts", "uh", "uhl", "ung, ong", "uu",
"v", "w", "wh", "yoo", "z", "zh", "robot0", "robot1", "robot2", "robot3", "robot4", "robot5", "robot6", "robot7", "robot8", "robot9", "alarm0", "alarm1", "alarm2", "alarm3", "alarm4", "alarm5",
"alarm6", "alarm7", "alarm8", "alarm9", "beep0", "beep1", "beep2", "beep3", "beep4", "beep5", "beep6", "beep7", "beep8", "beep9", "biological0", "biological1", "biological2", "biological3", "biological4", "biological5", "biological6", "biological7",
"biological8", "biological9", "DTMF0", "DTMF1", "DTMF2", "DTMF3", "DTMF4", "DTMF5", "DTMF6", "DTMF7", "DTMF8", "DTMF9", "dot", "#", "Ping", "Piston", "wow"
};
char* phoNeme[] = {"AY", "AX", "AW", "OH", "EY", "OHIY", "OHIH", "AWRR", "EYIY", "EYRR", "BE", "BO", "EB", "OB", "CH", "DE", "DO", "ED", "OD", "IY", "IYRR", "EH",
"AXRR", "FF", "GE", "GO", "EG", "OG", "HE", "HO", "IH", "NGE", "IYEH", "JH", "KE", "KO", "EK", "OK", "LE", "LO", "MM", "NE", "NO", "OW",
"OWWW", "UW", "IHWW", "OWRR", "AXUW", "AYWW", "OWIY", "PE", "PO", "RR", "SE", "SO", "SH", "TT", "TU", "DH", "TH", "TS", "UX", "EHLL", "NGO", "UH",
"VV", "WW", "WH", "IYUW", "ZZ", "ZH", "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "A0", "A1", "A2", "A3", "A4", "A5",
"A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7",
"C8", "C9", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "M0", "M1", "M2"
};
int phoTime[] = {70, 70, 70, 70, 70, 200, 185, 200, 165, 200, 45, 45, 10, 10, 70, 45, 45, 10, 10, 70, 200, 70,
190, 70, 55, 55, 55, 55, 70, 70, 70, 70, 170, 70, 55, 55, 55, 45, 70, 70, 70, 70, 70, 70,
131, 70, 170, 185, 170, 200, 225, 99, 99, 70, 40, 40, 50, 50, 70, 70, 40, 170, 70, 140, 70, 70,
70, 70, 70, 180, 70, 70, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 300, 101, 102, 540, 530, 500,
135, 600, 300, 250, 200, 270, 280, 260, 300, 100, 104, 100, 270, 262, 160, 300, 182, 120, 175, 350, 160, 260,
95, 75, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 125, 250, 530
};
//__________________________________________________________
void setup()
{
//set up tx and rx pins
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(E7, INPUT);
pinMode(E6, INPUT);
pinMode(E5, INPUT);
pinMode(E4, INPUT);
pinMode(E3, INPUT);
pinMode(E2, INPUT);
pinMode(E1, INPUT);
pinMode(E0, INPUT);
pinMode(MR, INPUT);
pinMode(D2Buf, INPUT);
pinMode(D1Spk, INPUT);
pinMode( D0Ready, INPUT);
digitalWrite(E7, LOW);
digitalWrite(E6, LOW);
digitalWrite(E5, LOW);
digitalWrite(E4, LOW);
digitalWrite(E3, LOW);
digitalWrite(E2, LOW);
digitalWrite(E1, LOW);
digitalWrite(E0, LOW);
digitalWrite(MR, LOW);
digitalWrite(D2Buf, HIGH);
digitalWrite(D1Spk, HIGH);
digitalWrite(D0Ready, HIGH);
tft.begin();
tft.setRotation(0);//Portrait w/ power cord at bottom
speakjet.begin(9600);
Serial.begin(9600);
}
//_____________________________________________
void loop()
{
//Set starting text coordinates
int xpos = 50;
int ypos = 100;
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.setFreeFont(GLCD); // Select the orginal small GLCD font by using NULL or GLCD
tft.setFreeFont(FSB24); // Select Free Serif 24 point font
digitalWrite(MR, HIGH);
Serial.println("MR HIGH");
delay(1000);
digitalWrite(MR, LOW);
Serial.println("MR LOW");
digitalWrite(E7, HIGH);
delay(500);
digitalWrite(E7, LOW);
//Hello
Serial.println("Hello");
speakjet.write(183);
delay(70);
speakjet.write(131);
delay(70);
speakjet.write(146);
delay(70);
speakjet.write(137);
delay(500);
Serial.println("Hello");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("Hello"); // Print the color name onto the TFT screen
speakjet.write(phoCode[28]);//183
delay(phoTime[28]);
speakjet.write(phoCode[21]);//131
delay(phoTime[21]);
speakjet.write(phoCode[39]);//146
delay(phoTime[39]);
speakjet.write(phoCode[43]);//137
delay(phoTime[43]);
//thank you 190, 130, 143, 195,160
Serial.println("Thank you");
speakjet.write(190);
delay(40);
speakjet.write(130);
delay(70);
speakjet.write(143);
delay(70);
speakjet.write(195);
delay(55);
speakjet.write(160);
delay(500);
//thank you 190, 130, 143, 195,160
Serial.println("Thank you");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("Thank you"); // Print the color name onto the TFT screen
speakjet.write(phoCode[60]);//190
delay(phoTime[60]);
speakjet.write(phoCode[60]);//190
delay(phoTime[60]);
speakjet.write(phoCode[4]);//130
delay(phoTime[4]);
speakjet.write(phoCode[31]);//143
delay(phoTime[31]);
speakjet.write(phoCode[35]);//195
delay(phoTime[35]);
speakjet.write(phoCode[69]);//160
delay(phoTime[69]);
delay(500);
//Please 198, 145,128, 167
Serial.println("Please");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("Please"); // Print the color name onto the TFT screen
speakjet.write(phoCode[51]);//198
Serial.println("Please");
speakjet.write(phoCode[51]);//198
delay(phoTime[51]);
speakjet.write(phoCode[38]);//145
delay(phoTime[38]);
speakjet.write(phoCode[19]);//128
delay(phoTime[19]);
speakjet.write(phoCode[19]);//128
delay(phoTime[19]);
speakjet.write(phoCode[70]);//167
delay(phoTime[70]);
speakjet.write(phoCode[70]);//167
delay(phoTime[70]);
delay(500);
//Tom 191,136,140
Serial.println("Tom");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("Tom "); // Print the color name onto the TFT screen
speakjet.write(phoCode[57]);//191
delay(phoTime[57]);
speakjet.write(phoCode[2]);//136
delay(phoTime[2]);
speakjet.write(phoCode[40]);//140
delay(phoTime[40]);
delay(500);
//take 192,130,196
Serial.println("take ");
// tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos + 50); // Set cursor near top left corner of screen
tft.print("take"); // Print the color name onto the TFT screen
speakjet.write(phoCode[58]);//192
delay(phoTime[58]);
speakjet.write(phoCode[4]);//130
delay(phoTime[4]);
speakjet.write(phoCode[4]);//130
delay(phoTime[4]);
speakjet.write(phoCode[36]);//196
delay(phoTime[36]);
delay(500);
//to 192,162
Serial.println("to ");
// tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos + 150); // Set cursor near top left corner of screen
tft.print("to"); // Print the color name onto the TFT screen
speakjet.write(phoCode[58]);//192
delay(phoTime[58]);
speakjet.write(phoCode[46]);//162
delay(phoTime[46]);
delay(500);
//bed 170, 131, 176
Serial.println("bed");
// tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos + 200); // Set cursor near top left corner of screen
tft.print("bed"); // Print the color name onto the TFT screen
speakjet.write(phoCode[10]);//170
delay(phoTime[10]);
speakjet.write(phoCode[21]);//131
delay(phoTime[21]);
speakjet.write(phoCode[21]);//131
delay(phoTime[21]);
speakjet.write(phoCode[17]);//176
delay(phoTime[17]);
delay(500);
//super
Serial.println("super");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("super"); // Print the color name onto the TFT screen
speakjet.write(phoCode[55]);//188
delay(phoTime[55]);
speakjet.write(phoCode[55]);//188
delay(phoTime[55]);
speakjet.write(phoCode[46]);//162
delay(phoTime[46]);
speakjet.write(phoCode[51]);//198
delay(phoTime[51]);
// speakjet.write(phoCode[51]);//198
// delay(phoTime[51]);
speakjet.write(phoCode[22]);//151
delay(phoTime[22]);
delay(500);
//bathroom
Serial.println("bathroom");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("bathroom"); // Print the color name onto the TFT screen
speakjet.write(phoCode[10]);//170 b
delay(phoTime[10]);
speakjet.write(phoCode[0]);//132 a
delay(phoTime[0]);
speakjet.write(phoCode[0]);//132 a
delay(phoTime[0]);
speakjet.write(phoCode[60]);//190
delay(phoTime[60]);
speakjet.write(phoCode[53]);//148
delay(phoTime[53]);
speakjet.write(phoCode[45]);//139
delay(phoTime[45]);
speakjet.write(phoCode[45]);//139
delay(phoTime[45]);
speakjet.write(phoCode[40]);//140
delay(phoTime[40]);
delay(500);
//chair
Serial.println("chair");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("chair"); // Print the color name onto the TFT screen
speakjet.write(phoCode[14]);//182
delay(phoTime[14]);
speakjet.write(phoCode[14]);//182
delay(phoTime[14]);
speakjet.write(phoCode[4]);//130
delay(phoTime[4]);
speakjet.write(phoCode[9]);//150
delay(phoTime[9]);
delay(500);
//help
Serial.println("help");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("help"); // Print the color name onto the TFT screen
speakjet.write(phoCode[28]);//183 h
delay(phoTime[28]);
speakjet.write(phoCode[21]);//131 e
delay(phoTime[21]);
speakjet.write(phoCode[39]);//146 l
delay(phoTime[39]);
speakjet.write(phoCode[52]);//199 p
delay(phoTime[52]);
delay(500);
//yes
Serial.println("yes");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("yes"); // Print the color name onto the TFT screen
speakjet.write(phoCode[32]);//158 y
delay(phoTime[28]);
speakjet.write(phoCode[21]);//131 e
delay(phoTime[21]);
speakjet.write(phoCode[54]);//187 s
delay(phoTime[54]);
delay(500);
//no
Serial.println("no");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("no"); // Print the color name onto the TFT screen
speakjet.write(phoCode[42]);//142 n
delay(phoTime[42]);
speakjet.write(phoCode[42]);//142 n
delay(phoTime[42]);
speakjet.write(phoCode[44]);//164 o
delay(phoTime[44]);
delay(500);
//The greatest glory in living lies not in never falling, but in rising every time we fall.
//the
Serial.println("the");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("the"); // Print the color name onto the TFT screen
speakjet.write(phoCode[59]);//169 th
delay(phoTime[59]);
speakjet.write(phoCode[62]);//134 e
delay(phoTime[62]);
delay(500);
//greatest
Serial.println("greatest");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("greatest"); // Print the color name onto the TFT screen
speakjet.write(phoCode[24]);//g 178 24
delay(phoTime[24]);
speakjet.write(phoCode[53]);//r 148 53
delay(phoTime[53]);
speakjet.write(phoCode[9]);//ay 150 9
delay(phoTime[9]);
speakjet.write(phoCode[58]);//t 192 58
delay(phoTime[58]);
speakjet.write(phoCode[21]);//e 131 21
delay(phoTime[21]);
speakjet.write(phoCode[55]);//s 188 55
delay(phoTime[55]);
speakjet.write(phoCode[57]);//t 191 57
delay(phoTime[57]);
delay(500);
//glory
Serial.println("glory");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("glory"); // Print the color name onto the TFT screen
speakjet.write(phoCode[25]);//g 179 25
delay(phoTime[25]);
speakjet.write(phoCode[53]);//l 145 38
delay(phoTime[53]);
speakjet.write(phoCode[47]);//or 153 47
delay(phoTime[47]);
speakjet.write(phoCode[53]);//r 148 53
delay(phoTime[53]);
speakjet.write(phoCode[19]);//ee 128 19
delay(phoTime[19]);
delay(500);
//in
Serial.println("in");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("in"); // Print the color name onto the TFT screen
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[41]);//n 141 41
delay(phoTime[41]);
delay(500);
//living
Serial.println("living");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("living"); // Print the color name onto the TFT screen
speakjet.write(phoCode[53]);//l 145 38
delay(phoTime[53]);
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[66]);//v 166 66
delay(phoTime[66]);
speakjet.write(phoCode[31]);//ing 143 31
delay(phoTime[31]);
delay(500);
//lies
Serial.println("lies");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("lies"); // Print the color name onto the TFT screen
speakjet.write(phoCode[53]);//l 145 38
delay(phoTime[53]);
speakjet.write(phoCode[5]);//i 155 5
delay(phoTime[5]);
speakjet.write(phoCode[66]);//z 167 70
delay(phoTime[66]);
delay(500);
digitalWrite(MR, HIGH);
Serial.println("MR HIGH");
delay(500);
digitalWrite(MR, LOW);
Serial.println("MR LOW");
//not
Serial.println("not");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("not"); // Print the color name onto the TFT screen
speakjet.write(phoCode[42]);//n 142 42
delay(phoTime[42]);
speakjet.write(phoCode[3]);//o 135 3
delay(phoTime[3]);
speakjet.write(phoCode[57]);//t 191 57
delay(phoTime[57]);
delay(500);
//in
Serial.println("in");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("in"); // Print the color name onto the TFT screen
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[41]);//n 141 41
delay(phoTime[41]);
delay(500);
//never
Serial.println("never");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("never"); // Print the color name onto the TFT screen
speakjet.write(phoCode[42]);//n 142 42
delay(phoTime[42]);
speakjet.write(phoCode[21]);//e 131 21
delay(phoTime[21]);
speakjet.write(phoCode[21]);//e 131 21
delay(phoTime[21]);
speakjet.write(phoCode[66]); // v 166 66
delay(phoTime[66]);
speakjet.write(phoCode[22]); // er 151 22
delay(phoTime[22]);
delay(500);
//falling
Serial.println("falling");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("falling"); // Print the color name onto the TFT screen
speakjet.write(phoCode[23]);//f 186 23
delay(phoTime[23]);
speakjet.write(phoCode[2]);//ah 136 2
delay(phoTime[2]);
speakjet.write(phoCode[39]);//ll 146 39
delay(phoTime[39]);
speakjet.write(phoCode[31]);//ing 143 31
delay(phoTime[31]);
delay(500);
digitalWrite(MR, HIGH);
Serial.println("MR HIGH");
delay(500);
digitalWrite(MR, LOW);
Serial.println("MR LOW");
//but
Serial.println("but");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("but"); // Print the color name onto the TFT screen
speakjet.write(phoCode[13]);//b 173 13
delay(phoTime[13]);
speakjet.write(phoCode[62]);//uh 134 62
delay(phoTime[62]);
speakjet.write(phoCode[57]);//t 191 57
delay(phoTime[57]);
delay(500);
//in
Serial.println("in");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("in"); // Print the color name onto the TFT screen
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[30]);//i 129 30
delay(phoTime[30]);
speakjet.write(phoCode[41]);//n 141 41
delay(phoTime[41]);
delay(500);
//rising
Serial.println("rising");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("rising"); // Print the color name onto the TFT screen
speakjet.write(phoCode[53]);//r 148 53
delay(phoTime[53]);
speakjet.write(phoCode[6]);//aiy 157 6
delay(phoTime[6]);
speakjet.write(phoCode[66]);//z 167 70
delay(phoTime[66]);
speakjet.write(phoCode[31]);//ing 143 31
delay(phoTime[31]);
delay(500);
//every
Serial.println("every");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("every"); // Print the color name onto the TFT screen
speakjet.write(phoCode[21]);//e 131 21
delay(phoTime[21]);
speakjet.write(phoCode[21]);//e 131 21
delay(phoTime[21]);
speakjet.write(phoCode[66]); // v 166 66
delay(phoTime[66]);
speakjet.write(phoCode[22]); // er 151 22
delay(phoTime[22]);
speakjet.write(phoCode[53]);//r 148 53
delay(phoTime[53]);
speakjet.write(phoCode[19]);//ee 128 19
delay(phoTime[19]);
delay(500);
//time
Serial.println("time");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("time"); // Print the color name onto the TFT screen
speakjet.write(phoCode[58]);//t 192 58
delay(phoTime[58]);
speakjet.write(phoCode[6]);//aiy 157 6
delay(phoTime[6]);
speakjet.write(phoCode[40]); // m 140 40
delay(phoTime[40]);
delay(500);
//we
Serial.println("we");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("we"); // Print the color name onto the TFT screen
speakjet.write(phoCode[67]);//w 147 67
delay(phoTime[67]);
speakjet.write(phoCode[19]);//ee 128 19
delay(phoTime[19]);
delay(500);
//fall
Serial.println("fall");
tft.fillScreen(TFT_BLUE);
tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen
tft.print("fall"); // Print the color name onto the TFT screen
speakjet.write(phoCode[23]);//f 186 23
delay(phoTime[23]);
speakjet.write(phoCode[2]);//ah 136 2
delay(phoTime[2]);
speakjet.write(phoCode[39]);//ll 146 39
delay(phoTime[39]);
delay(500);
//repeat all 127 sounds
for (int j = 0; j < 127; j++)
{
Serial.print("j= ");
Serial.println(j);
Serial.println(phoSound[j]);
for (int i = 0; i < 4; i++)
{ speakjet.write(phoCode[j]);
delay(phoTime[j]);
delay(500);
}
digitalWrite(MR, HIGH);
delay(1000);
digitalWrite(MR, LOW);
delay(500);
}
}
Comments