Speakjet w/ TFT Screen
This project demonstrates some of the features of the Speakjet integrated circuit in which any word can be created.
Components and supplies
1
Speakjet IC
1
Jumper wires (generic)
1
TFT LCD, 3.5 "
1
Arduino Mega 2560
Project description
Code
SpeakjetTFTPost.ino
arduino
It is the code for Speakjet and some words using the speakjet library.
1//SpeakjetIntro 2//by Dana Dietz 3//This sketch has been created for use with the SpeakJet IC and the TFT for AtMega 4 5#include <SoftwareSerial.h> //Speakjet needs to act as a serial port 6#define rxPin 0 //receive pin 0, old 2 7#define txPin 6 //transmission pin 6 on Mega connects to pin 10 on speakjet 8 9 10#include <TFT_HX8357.h> // Hardware-specific library 11 12#include "Free_Fonts.h" // Include the header file attached to this sketch 13 14TFT_HX8357 tft = TFT_HX8357(); // Invoke custom library 15 16unsigned long drawTime = 0; 17 18/*speakjet has 18 pins 19 1 = event 7 (E7)/RC1; active low until used //Ground event pins if not used//12 20 2 = E6/RC0; active low until used //Ground event pins if not used//11 21 3 = E5; active low until used //Ground event pins if not used/10 22 4 = E4; active low until used //Ground event pins if not used/9 23 5 = GND 24 6 = E3; active low until used //Ground event pins if not used/8 25 7 = E2; active low until used //Ground event pins if not used/7 26 8 = E1; active low until used //Ground event pins if not used//5 27 9 = E0; active low until used //Ground event pins if not used/4 28 10 = RCX Serial Input (Connect to txPin 1) 29 11 = Master Reset, Active Low, Reset High/A0 30 12 = M1 (Baud Configure); V+ thru resistor for normal operation; ground for demo/test mode 31 13 = M0 (Demo Mode); Ground for normal operation, high for demo 32 14 = V+ (+2.0 -5.5 Volts DC) 33 15 = D2/ Buffer Half Full; Data out 2 external; buffer half full internal; active low external (?); active high internal//A1 34 16 = Data Out 1 (External)/ Speaking Status (Internal); Active high? internal...datasheet omitted info//A2 35 17 = Data Out 0 (External)/ Ready (internal); default is ready and active high//A3 36 18 = Voice Output; connect to 2 pole low pass filter followed by an audio amplifier and speaker 37*/ 38 39//set up pin connections to speakjet 40const int E7 = 12; 41const int E6 = 11; 42const int E5 = 10; 43const int E4 = 9; 44const int E3 = 8; 45const int E2 = 7; 46const int E1 = 5; 47const int E0 = 4; 48const int MR = A0; 49const int D2Buf = A1; 50const int D1Spk = A2; 51const int D0Ready = A3; //active high default 52 53//Create an object serial port for speakjet 54SoftwareSerial speakjet = SoftwareSerial(rxPin, txPin); 55int TheReadByte = 0; 56 57//The following is from the speakjet library and my own sound interpretation 58 59int phoCode[] = {132, 133, 136, 135, 130, 155, 157, 152, 154, 150, 170, 171, 172, 173, 182, 174, 175, 176, 177, 128, 149, 131, 60 151, 186, 178, 179, 180, 181, 183, 184, 129, 143, 158, 165, 194, 195, 196, 197, 145, 146, 140, 141, 142, 137, 61 164, 139, 162, 153, 161, 163, 156, 198, 199, 148, 187, 188, 189, 191, 192, 169, 190, 193, 134, 159, 144, 138, 62 166, 147, 185, 160, 167, 168, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 63 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 64 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254 65 }; 66 67//voice sounds 0-71, robot 72-81, alarm 82-91, beeps 92-101, biologic 102-111, DTMF Phone 112-123, Misc 124-126 68char* 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", 69 "er", "f", "g", "g", "g", "g", "h", "h", "i", "ing", "iyeh", "j", "k", "k", "k", "k", "l", "lo", "m", "n", "no", "oh", 70 "oh", "oo", "oo", "or", "ow", "ow", "oy", "p", "p", "r", "s", "s", "sh", "t", "t", "th", "th", "ts", "uh", "uhl", "ung, ong", "uu", 71 "v", "w", "wh", "yoo", "z", "zh", "robot0", "robot1", "robot2", "robot3", "robot4", "robot5", "robot6", "robot7", "robot8", "robot9", "alarm0", "alarm1", "alarm2", "alarm3", "alarm4", "alarm5", 72 "alarm6", "alarm7", "alarm8", "alarm9", "beep0", "beep1", "beep2", "beep3", "beep4", "beep5", "beep6", "beep7", "beep8", "beep9", "biological0", "biological1", "biological2", "biological3", "biological4", "biological5", "biological6", "biological7", 73 "biological8", "biological9", "DTMF0", "DTMF1", "DTMF2", "DTMF3", "DTMF4", "DTMF5", "DTMF6", "DTMF7", "DTMF8", "DTMF9", "dot", "#", "Ping", "Piston", "wow" 74 }; 75 76char* phoNeme[] = {"AY", "AX", "AW", "OH", "EY", "OHIY", "OHIH", "AWRR", "EYIY", "EYRR", "BE", "BO", "EB", "OB", "CH", "DE", "DO", "ED", "OD", "IY", "IYRR", "EH", 77 "AXRR", "FF", "GE", "GO", "EG", "OG", "HE", "HO", "IH", "NGE", "IYEH", "JH", "KE", "KO", "EK", "OK", "LE", "LO", "MM", "NE", "NO", "OW", 78 "OWWW", "UW", "IHWW", "OWRR", "AXUW", "AYWW", "OWIY", "PE", "PO", "RR", "SE", "SO", "SH", "TT", "TU", "DH", "TH", "TS", "UX", "EHLL", "NGO", "UH", 79 "VV", "WW", "WH", "IYUW", "ZZ", "ZH", "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "A0", "A1", "A2", "A3", "A4", "A5", 80 "A6", "A7", "A8", "A9", "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", 81 "C8", "C9", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "M0", "M1", "M2" 82 }; 83 84int phoTime[] = {70, 70, 70, 70, 70, 200, 185, 200, 165, 200, 45, 45, 10, 10, 70, 45, 45, 10, 10, 70, 200, 70, 85 190, 70, 55, 55, 55, 55, 70, 70, 70, 70, 170, 70, 55, 55, 55, 45, 70, 70, 70, 70, 70, 70, 86 131, 70, 170, 185, 170, 200, 225, 99, 99, 70, 40, 40, 50, 50, 70, 70, 40, 170, 70, 140, 70, 70, 87 70, 70, 70, 180, 70, 70, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 300, 101, 102, 540, 530, 500, 88 135, 600, 300, 250, 200, 270, 280, 260, 300, 100, 104, 100, 270, 262, 160, 300, 182, 120, 175, 350, 160, 260, 89 95, 75, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 125, 250, 530 90 }; 91 92 93 94//__________________________________________________________ 95void setup() 96{ 97 //set up tx and rx pins 98 pinMode(rxPin, INPUT); 99 pinMode(txPin, OUTPUT); 100 pinMode(E7, INPUT); 101 pinMode(E6, INPUT); 102 pinMode(E5, INPUT); 103 pinMode(E4, INPUT); 104 pinMode(E3, INPUT); 105 pinMode(E2, INPUT); 106 pinMode(E1, INPUT); 107 pinMode(E0, INPUT); 108 pinMode(MR, INPUT); 109 pinMode(D2Buf, INPUT); 110 pinMode(D1Spk, INPUT); 111 pinMode( D0Ready, INPUT); 112 digitalWrite(E7, LOW); 113 digitalWrite(E6, LOW); 114 digitalWrite(E5, LOW); 115 digitalWrite(E4, LOW); 116 digitalWrite(E3, LOW); 117 digitalWrite(E2, LOW); 118 digitalWrite(E1, LOW); 119 digitalWrite(E0, LOW); 120 digitalWrite(MR, LOW); 121 digitalWrite(D2Buf, HIGH); 122 digitalWrite(D1Spk, HIGH); 123 digitalWrite(D0Ready, HIGH); 124 125 tft.begin(); 126 tft.setRotation(0);//Portrait w/ power cord at bottom 127 128 129 speakjet.begin(9600); 130 Serial.begin(9600); 131 132} 133 134//_____________________________________________ 135void loop() 136{ 137 138 //Set starting text coordinates 139 int xpos = 50; 140 int ypos = 100; 141 tft.setTextColor(TFT_YELLOW, TFT_BLACK); 142 tft.setFreeFont(GLCD); // Select the orginal small GLCD font by using NULL or GLCD 143 tft.setFreeFont(FSB24); // Select Free Serif 24 point font 144 145 digitalWrite(MR, HIGH); 146 Serial.println("MR HIGH"); 147 delay(1000); 148 digitalWrite(MR, LOW); 149 Serial.println("MR LOW"); 150 151 digitalWrite(E7, HIGH); 152 delay(500); 153 digitalWrite(E7, LOW); 154 155 156 //Hello 157 Serial.println("Hello"); 158 speakjet.write(183); 159 delay(70); 160 speakjet.write(131); 161 delay(70); 162 speakjet.write(146); 163 delay(70); 164 speakjet.write(137); 165 delay(500); 166 167 168 Serial.println("Hello"); 169 tft.fillScreen(TFT_BLUE); 170 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 171 tft.print("Hello"); // Print the color name onto the TFT screen 172 speakjet.write(phoCode[28]);//183 173 delay(phoTime[28]); 174 speakjet.write(phoCode[21]);//131 175 delay(phoTime[21]); 176 speakjet.write(phoCode[39]);//146 177 delay(phoTime[39]); 178 speakjet.write(phoCode[43]);//137 179 delay(phoTime[43]); 180 181 //thank you 190, 130, 143, 195,160 182 Serial.println("Thank you"); 183 speakjet.write(190); 184 delay(40); 185 speakjet.write(130); 186 delay(70); 187 speakjet.write(143); 188 delay(70); 189 speakjet.write(195); 190 delay(55); 191 speakjet.write(160); 192 delay(500); 193 194 //thank you 190, 130, 143, 195,160 195 Serial.println("Thank you"); 196 tft.fillScreen(TFT_BLUE); 197 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 198 tft.print("Thank you"); // Print the color name onto the TFT screen 199 speakjet.write(phoCode[60]);//190 200 delay(phoTime[60]); 201 speakjet.write(phoCode[60]);//190 202 delay(phoTime[60]); 203 speakjet.write(phoCode[4]);//130 204 delay(phoTime[4]); 205 speakjet.write(phoCode[31]);//143 206 delay(phoTime[31]); 207 speakjet.write(phoCode[35]);//195 208 delay(phoTime[35]); 209 speakjet.write(phoCode[69]);//160 210 delay(phoTime[69]); 211 delay(500); 212 213 //Please 198, 145,128, 167 214 Serial.println("Please"); 215 tft.fillScreen(TFT_BLUE); 216 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 217 tft.print("Please"); // Print the color name onto the TFT screen 218 speakjet.write(phoCode[51]);//198 219 Serial.println("Please"); 220 speakjet.write(phoCode[51]);//198 221 delay(phoTime[51]); 222 speakjet.write(phoCode[38]);//145 223 delay(phoTime[38]); 224 speakjet.write(phoCode[19]);//128 225 delay(phoTime[19]); 226 speakjet.write(phoCode[19]);//128 227 delay(phoTime[19]); 228 speakjet.write(phoCode[70]);//167 229 delay(phoTime[70]); 230 speakjet.write(phoCode[70]);//167 231 delay(phoTime[70]); 232 delay(500); 233 234 //Tom 191,136,140 235 Serial.println("Tom"); 236 tft.fillScreen(TFT_BLUE); 237 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 238 tft.print("Tom "); // Print the color name onto the TFT screen 239 speakjet.write(phoCode[57]);//191 240 delay(phoTime[57]); 241 speakjet.write(phoCode[2]);//136 242 delay(phoTime[2]); 243 speakjet.write(phoCode[40]);//140 244 delay(phoTime[40]); 245 delay(500); 246 247 //take 192,130,196 248 Serial.println("take "); 249 // tft.fillScreen(TFT_BLUE); 250 tft.setCursor(xpos, ypos + 50); // Set cursor near top left corner of screen 251 tft.print("take"); // Print the color name onto the TFT screen 252 speakjet.write(phoCode[58]);//192 253 delay(phoTime[58]); 254 speakjet.write(phoCode[4]);//130 255 delay(phoTime[4]); 256 speakjet.write(phoCode[4]);//130 257 delay(phoTime[4]); 258 speakjet.write(phoCode[36]);//196 259 delay(phoTime[36]); 260 delay(500); 261 262 //to 192,162 263 Serial.println("to "); 264 // tft.fillScreen(TFT_BLUE); 265 tft.setCursor(xpos, ypos + 150); // Set cursor near top left corner of screen 266 tft.print("to"); // Print the color name onto the TFT screen 267 speakjet.write(phoCode[58]);//192 268 delay(phoTime[58]); 269 speakjet.write(phoCode[46]);//162 270 delay(phoTime[46]); 271 delay(500); 272 273 //bed 170, 131, 176 274 Serial.println("bed"); 275 // tft.fillScreen(TFT_BLUE); 276 tft.setCursor(xpos, ypos + 200); // Set cursor near top left corner of screen 277 tft.print("bed"); // Print the color name onto the TFT screen 278 speakjet.write(phoCode[10]);//170 279 delay(phoTime[10]); 280 speakjet.write(phoCode[21]);//131 281 delay(phoTime[21]); 282 speakjet.write(phoCode[21]);//131 283 delay(phoTime[21]); 284 speakjet.write(phoCode[17]);//176 285 delay(phoTime[17]); 286 delay(500); 287 288 289 290 //super 291 Serial.println("super"); 292 tft.fillScreen(TFT_BLUE); 293 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 294 tft.print("super"); // Print the color name onto the TFT screen 295 speakjet.write(phoCode[55]);//188 296 delay(phoTime[55]); 297 speakjet.write(phoCode[55]);//188 298 delay(phoTime[55]); 299 speakjet.write(phoCode[46]);//162 300 delay(phoTime[46]); 301 speakjet.write(phoCode[51]);//198 302 delay(phoTime[51]); 303 // speakjet.write(phoCode[51]);//198 304 // delay(phoTime[51]); 305 speakjet.write(phoCode[22]);//151 306 delay(phoTime[22]); 307 delay(500); 308 309 //bathroom 310 Serial.println("bathroom"); 311 tft.fillScreen(TFT_BLUE); 312 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 313 tft.print("bathroom"); // Print the color name onto the TFT screen 314 speakjet.write(phoCode[10]);//170 b 315 delay(phoTime[10]); 316 speakjet.write(phoCode[0]);//132 a 317 delay(phoTime[0]); 318 speakjet.write(phoCode[0]);//132 a 319 delay(phoTime[0]); 320 speakjet.write(phoCode[60]);//190 321 delay(phoTime[60]); 322 speakjet.write(phoCode[53]);//148 323 delay(phoTime[53]); 324 speakjet.write(phoCode[45]);//139 325 delay(phoTime[45]); 326 speakjet.write(phoCode[45]);//139 327 delay(phoTime[45]); 328 speakjet.write(phoCode[40]);//140 329 delay(phoTime[40]); 330 delay(500); 331 332 //chair 333 Serial.println("chair"); 334 tft.fillScreen(TFT_BLUE); 335 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 336 tft.print("chair"); // Print the color name onto the TFT screen 337 speakjet.write(phoCode[14]);//182 338 delay(phoTime[14]); 339 speakjet.write(phoCode[14]);//182 340 delay(phoTime[14]); 341 speakjet.write(phoCode[4]);//130 342 delay(phoTime[4]); 343 speakjet.write(phoCode[9]);//150 344 delay(phoTime[9]); 345 delay(500); 346 347 //help 348 Serial.println("help"); 349 tft.fillScreen(TFT_BLUE); 350 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 351 tft.print("help"); // Print the color name onto the TFT screen 352 speakjet.write(phoCode[28]);//183 h 353 delay(phoTime[28]); 354 speakjet.write(phoCode[21]);//131 e 355 delay(phoTime[21]); 356 speakjet.write(phoCode[39]);//146 l 357 delay(phoTime[39]); 358 speakjet.write(phoCode[52]);//199 p 359 delay(phoTime[52]); 360 delay(500); 361 362 //yes 363 Serial.println("yes"); 364 tft.fillScreen(TFT_BLUE); 365 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 366 tft.print("yes"); // Print the color name onto the TFT screen 367 speakjet.write(phoCode[32]);//158 y 368 delay(phoTime[28]); 369 speakjet.write(phoCode[21]);//131 e 370 delay(phoTime[21]); 371 speakjet.write(phoCode[54]);//187 s 372 delay(phoTime[54]); 373 delay(500); 374 375 //no 376 Serial.println("no"); 377 tft.fillScreen(TFT_BLUE); 378 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 379 tft.print("no"); // Print the color name onto the TFT screen 380 speakjet.write(phoCode[42]);//142 n 381 delay(phoTime[42]); 382 speakjet.write(phoCode[42]);//142 n 383 delay(phoTime[42]); 384 speakjet.write(phoCode[44]);//164 o 385 delay(phoTime[44]); 386 delay(500); 387 388 389 //The greatest glory in living lies not in never falling, but in rising every time we fall. 390 391 //the 392 Serial.println("the"); 393 tft.fillScreen(TFT_BLUE); 394 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 395 tft.print("the"); // Print the color name onto the TFT screen 396 speakjet.write(phoCode[59]);//169 th 397 delay(phoTime[59]); 398 speakjet.write(phoCode[62]);//134 e 399 delay(phoTime[62]); 400 delay(500); 401 402 //greatest 403 Serial.println("greatest"); 404 tft.fillScreen(TFT_BLUE); 405 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 406 tft.print("greatest"); // Print the color name onto the TFT screen 407 speakjet.write(phoCode[24]);//g 178 24 408 delay(phoTime[24]); 409 speakjet.write(phoCode[53]);//r 148 53 410 delay(phoTime[53]); 411 speakjet.write(phoCode[9]);//ay 150 9 412 delay(phoTime[9]); 413 speakjet.write(phoCode[58]);//t 192 58 414 delay(phoTime[58]); 415 speakjet.write(phoCode[21]);//e 131 21 416 delay(phoTime[21]); 417 speakjet.write(phoCode[55]);//s 188 55 418 delay(phoTime[55]); 419 speakjet.write(phoCode[57]);//t 191 57 420 delay(phoTime[57]); 421 delay(500); 422 423 //glory 424 Serial.println("glory"); 425 tft.fillScreen(TFT_BLUE); 426 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 427 tft.print("glory"); // Print the color name onto the TFT screen 428 speakjet.write(phoCode[25]);//g 179 25 429 delay(phoTime[25]); 430 speakjet.write(phoCode[53]);//l 145 38 431 delay(phoTime[53]); 432 speakjet.write(phoCode[47]);//or 153 47 433 delay(phoTime[47]); 434 speakjet.write(phoCode[53]);//r 148 53 435 delay(phoTime[53]); 436 speakjet.write(phoCode[19]);//ee 128 19 437 delay(phoTime[19]); 438 delay(500); 439 440 //in 441 Serial.println("in"); 442 tft.fillScreen(TFT_BLUE); 443 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 444 tft.print("in"); // Print the color name onto the TFT screen 445 speakjet.write(phoCode[30]);//i 129 30 446 delay(phoTime[30]); 447 speakjet.write(phoCode[30]);//i 129 30 448 delay(phoTime[30]); 449 speakjet.write(phoCode[41]);//n 141 41 450 delay(phoTime[41]); 451 delay(500); 452 453 //living 454 Serial.println("living"); 455 tft.fillScreen(TFT_BLUE); 456 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 457 tft.print("living"); // Print the color name onto the TFT screen 458 speakjet.write(phoCode[53]);//l 145 38 459 delay(phoTime[53]); 460 speakjet.write(phoCode[30]);//i 129 30 461 delay(phoTime[30]); 462 speakjet.write(phoCode[30]);//i 129 30 463 delay(phoTime[30]); 464 speakjet.write(phoCode[66]);//v 166 66 465 delay(phoTime[66]); 466 speakjet.write(phoCode[31]);//ing 143 31 467 delay(phoTime[31]); 468 delay(500); 469 470 //lies 471 Serial.println("lies"); 472 tft.fillScreen(TFT_BLUE); 473 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 474 tft.print("lies"); // Print the color name onto the TFT screen 475 speakjet.write(phoCode[53]);//l 145 38 476 delay(phoTime[53]); 477 speakjet.write(phoCode[5]);//i 155 5 478 delay(phoTime[5]); 479 speakjet.write(phoCode[66]);//z 167 70 480 delay(phoTime[66]); 481 delay(500); 482 483 digitalWrite(MR, HIGH); 484 Serial.println("MR HIGH"); 485 delay(500); 486 digitalWrite(MR, LOW); 487 Serial.println("MR LOW"); 488 489 //not 490 Serial.println("not"); 491 tft.fillScreen(TFT_BLUE); 492 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 493 tft.print("not"); // Print the color name onto the TFT screen 494 speakjet.write(phoCode[42]);//n 142 42 495 delay(phoTime[42]); 496 speakjet.write(phoCode[3]);//o 135 3 497 delay(phoTime[3]); 498 speakjet.write(phoCode[57]);//t 191 57 499 delay(phoTime[57]); 500 delay(500); 501 502 //in 503 Serial.println("in"); 504 tft.fillScreen(TFT_BLUE); 505 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 506 tft.print("in"); // Print the color name onto the TFT screen 507 speakjet.write(phoCode[30]);//i 129 30 508 delay(phoTime[30]); 509 speakjet.write(phoCode[30]);//i 129 30 510 delay(phoTime[30]); 511 speakjet.write(phoCode[41]);//n 141 41 512 delay(phoTime[41]); 513 delay(500); 514 515 //never 516 Serial.println("never"); 517 tft.fillScreen(TFT_BLUE); 518 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 519 tft.print("never"); // Print the color name onto the TFT screen 520 speakjet.write(phoCode[42]);//n 142 42 521 delay(phoTime[42]); 522 speakjet.write(phoCode[21]);//e 131 21 523 delay(phoTime[21]); 524 speakjet.write(phoCode[21]);//e 131 21 525 delay(phoTime[21]); 526 speakjet.write(phoCode[66]); // v 166 66 527 delay(phoTime[66]); 528 speakjet.write(phoCode[22]); // er 151 22 529 delay(phoTime[22]); 530 delay(500); 531 532 //falling 533 Serial.println("falling"); 534 tft.fillScreen(TFT_BLUE); 535 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 536 tft.print("falling"); // Print the color name onto the TFT screen 537 speakjet.write(phoCode[23]);//f 186 23 538 delay(phoTime[23]); 539 speakjet.write(phoCode[2]);//ah 136 2 540 delay(phoTime[2]); 541 speakjet.write(phoCode[39]);//ll 146 39 542 delay(phoTime[39]); 543 speakjet.write(phoCode[31]);//ing 143 31 544 delay(phoTime[31]); 545 delay(500); 546 547 548 digitalWrite(MR, HIGH); 549 Serial.println("MR HIGH"); 550 delay(500); 551 digitalWrite(MR, LOW); 552 Serial.println("MR LOW"); 553 554 555//but 556 Serial.println("but"); 557 tft.fillScreen(TFT_BLUE); 558 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 559 tft.print("but"); // Print the color name onto the TFT screen 560 speakjet.write(phoCode[13]);//b 173 13 561 delay(phoTime[13]); 562 speakjet.write(phoCode[62]);//uh 134 62 563 delay(phoTime[62]); 564 speakjet.write(phoCode[57]);//t 191 57 565 delay(phoTime[57]); 566 delay(500); 567 568 //in 569 Serial.println("in"); 570 tft.fillScreen(TFT_BLUE); 571 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 572 tft.print("in"); // Print the color name onto the TFT screen 573 speakjet.write(phoCode[30]);//i 129 30 574 delay(phoTime[30]); 575 speakjet.write(phoCode[30]);//i 129 30 576 delay(phoTime[30]); 577 speakjet.write(phoCode[41]);//n 141 41 578 delay(phoTime[41]); 579 delay(500); 580 581 //rising 582 Serial.println("rising"); 583 tft.fillScreen(TFT_BLUE); 584 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 585 tft.print("rising"); // Print the color name onto the TFT screen 586 speakjet.write(phoCode[53]);//r 148 53 587 delay(phoTime[53]); 588 speakjet.write(phoCode[6]);//aiy 157 6 589 delay(phoTime[6]); 590 speakjet.write(phoCode[66]);//z 167 70 591 delay(phoTime[66]); 592 speakjet.write(phoCode[31]);//ing 143 31 593 delay(phoTime[31]); 594 delay(500); 595 596 //every 597 Serial.println("every"); 598 tft.fillScreen(TFT_BLUE); 599 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 600 tft.print("every"); // Print the color name onto the TFT screen 601 speakjet.write(phoCode[21]);//e 131 21 602 delay(phoTime[21]); 603 speakjet.write(phoCode[21]);//e 131 21 604 delay(phoTime[21]); 605 speakjet.write(phoCode[66]); // v 166 66 606 delay(phoTime[66]); 607 speakjet.write(phoCode[22]); // er 151 22 608 delay(phoTime[22]); 609 speakjet.write(phoCode[53]);//r 148 53 610 delay(phoTime[53]); 611 speakjet.write(phoCode[19]);//ee 128 19 612 delay(phoTime[19]); 613 delay(500); 614 615 //time 616 Serial.println("time"); 617 tft.fillScreen(TFT_BLUE); 618 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 619 tft.print("time"); // Print the color name onto the TFT screen 620 speakjet.write(phoCode[58]);//t 192 58 621 delay(phoTime[58]); 622 speakjet.write(phoCode[6]);//aiy 157 6 623 delay(phoTime[6]); 624 speakjet.write(phoCode[40]); // m 140 40 625 delay(phoTime[40]); 626 delay(500); 627 628 //we 629 Serial.println("we"); 630 tft.fillScreen(TFT_BLUE); 631 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 632 tft.print("we"); // Print the color name onto the TFT screen 633 speakjet.write(phoCode[67]);//w 147 67 634 delay(phoTime[67]); 635 speakjet.write(phoCode[19]);//ee 128 19 636 delay(phoTime[19]); 637 delay(500); 638 639 640 //fall 641 Serial.println("fall"); 642 tft.fillScreen(TFT_BLUE); 643 tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen 644 tft.print("fall"); // Print the color name onto the TFT screen 645 speakjet.write(phoCode[23]);//f 186 23 646 delay(phoTime[23]); 647 speakjet.write(phoCode[2]);//ah 136 2 648 delay(phoTime[2]); 649 speakjet.write(phoCode[39]);//ll 146 39 650 delay(phoTime[39]); 651 delay(500); 652 653 //repeat all 127 sounds 654 for (int j = 0; j < 127; j++) 655 { 656 Serial.print("j= "); 657 Serial.println(j); 658 Serial.println(phoSound[j]); 659 for (int i = 0; i < 4; i++) 660 { speakjet.write(phoCode[j]); 661 delay(phoTime[j]); 662 delay(500); 663 } 664 digitalWrite(MR, HIGH); 665 delay(1000); 666 digitalWrite(MR, LOW); 667 delay(500); 668 } 669 670} 671
Downloadable files
Speakjet
This integrated circuit can be used to create virtually any word. Although the voice is robotic, it is flexible.
Speakjet
Speakjet
This integrated circuit can be used to create virtually any word. Although the voice is robotic, it is flexible.
Speakjet
Comments
Only logged in users can leave comments