// AlertDemo.pde // A demo demonstrating combined sound and speech effect for the SpeakJet Basic Shield // written by Galen Raben / www.droidbuilder.com 5-8-2010 // set up a new software serial port //rxPin: the pin on which to receive serial data //txPin: the pin on which to transmit serial data #include #define txPin 2 #define rxPin 3 // set up the SoftwareSerial port to connect to the SpeakJet SoftwareSerial speakJet = SoftwareSerial(rxPin, txPin); /* intruder alert 20, 96, 21, 114, 22, 88, 23, 5, 26, 3, 217, 129, 141, 191, 148, 139, 7, 174, 7, 133, 7, 151, 133, 145, 151, 191 v s p b r A7 \IH \NE \TT \RR \UW f \DE f \AX f \AXRR \AX \LE \AXRR \TT o p i e e a a a l e t n p s s s e c d e t t t d h a t */ byte alert[] = {20, 96, 21, 114, 22, 88, 23, 5, 26, 3, 217, 129, 141, 191, 148, 139, 7, 174, 7, 133, 7, 151, 133, 145, 151, 191}; void setup() { // define pin modes for tx, rx pins: // pinMode(rxPin, INPUT); //not needed for this demo pinMode(txPin, OUTPUT); speakJet.begin(9600); delay(1000); // wait a second for the Arduino resets to finish (says "ready") } void loop() { // continuous alert sounds for (int i=0; i