// DroidDemo.pde // SpeakJet StarWars Droid voice effect demo // shows how to do a simple voice effect // written by Galen Raben / www.droidbuilder.com 4-29-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); /* ROGER-ROGER (STARWARS DROID) 20, 96, 21, 120, 22, 120, 23, 12, 148, 135, 165, 151, 8, 148, 135, 165, 151 v s p b \RR \OH \JH \AXRR s \RR \OH \JH \AXRR o p i e l e t n e c d d h */ // byte array holding speech data byte sayThis[] = {20, 96, 21, 120, 22, 120, 23, 12, 148, 135, 165, 151, 8, 148, 135, 165, 151}; //"roger roger" void setup() { // define pin modes for tx, rx pins: // pinMode(rxPin, INPUT); //not needed for this simple demo pinMode(txPin, OUTPUT); speakJet.begin(9600); delay(1000); // wait a second for the Arduino resets to complete } void loop() { // send it to the SpeakJet for (int i=0; i