Check out the new projects site for A-i-S www.adventuresinsilicon.com

Saturday, October 3, 2009

Arduino code to control the SpeakJet chip

The following code controls the SpeakJet chip to say "Good luck and good hunting". It sends the correct codes from the TX pin (1). Otherwise just follow the diagram on page 3 of the SpeakJet datasheet.

//test of the SpeakJet chip
//Dingo_aus 3 October 2009

//connect the SpaekJet as per page 3 of its datasheet

#define WP 5

uint8_t announce[] = {
//game =\Slow \GE \EYIY \MM
//8, 178, 154, 140, WP,
//starts = \SE \TT \AW \RR \TS
//187,191,136,148, 193, WP,
WP,WP,WP,
//good =\Slow \GO \UH \UH \OD
8, 179, 138, 138, 177, WP,
//luck
8, 145, 8, 134, 7, 184, 196, WP,
//and
8, 132, 8, 141, 177, WP,
//good =\Slow \GO \UH \UH \OD
8, 179, 138, 138, 177, WP,
//hunting
8, 184, 8, 134, 141, 141, 8, 191, 8, 14, 143, 14, 143, 14, 143

};



int announce_len = 0;

void setup()
{
Serial.begin(9600);
announce_len = sizeof(announce);

}


void loop()
{
Serial.write(announce, announce_len);

while(1)
{

}

}