Shop OBEX P1 Docs P2 Docs Learn Events
Emic 2 connection — Parallax Forums

Emic 2 connection

heshamnoubyheshamnouby Posts: 1
edited 2015-07-06 23:46 in BASIC Stamp
I am using intel galielo 2 and I want make emic working on it so it compile will but the orange light blinking not solid that's mean there r error in communication


#include



// include the SoftwareSerial library so we can use it to talk to the Emic 2 module


#define rxPin 2 // Serial input (connects to Emic 2's SOUT pin)
#define txPin 3 // Serial output (connects to Emic 2's SIN pin)
#define ledPin 13 // Most Arduino boards have an on-board LED on this pin

// set up a new serial port
SoftwareSerial emicSerial = SoftwareSerial(rxPin, txPin);

void setup() // Set up code called once on start-up
{
// define pin modes
pinMode(ledPin, OUTPUT);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);

// set the data rate for the SoftwareSerial port
emicSerial.begin(9600);

digitalWrite(ledPin, LOW); // turn LED off

/*
When the Emic 2 powers on, it takes about 3 seconds for it to successfully
initialize. It then sends a ":" character to indicate it's ready to accept
commands. If the Emic 2 is already initialized, a CR will also cause it
to send a ":"
*/
emicSerial.print('
'); // Send a CR in case the system is already up
while (emicSerial.read() != ':'); // When the Emic 2 has initialized and is ready, it will send a single ':' character, so wait here until we receive it
delay(10); // Short delay
emicSerial.flush(); // Flush the receive buffer
}

void loop() // Main code, to run repeatedly
{
// Speak some text
emicSerial.print('S');
emicSerial.print("Hello. My name is the Emic 2 Text-to-Speech module. I would like to sing you a song."); // Send the desired string to convert to speech
emicSerial.print('
');
digitalWrite(ledPin, HIGH); // Turn on LED while Emic is outputting audio
while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command
digitalWrite(ledPin, LOW);

delay(500); // 1/2 second delay

// Sing a song
emicSerial.print("D1
");
digitalWrite(ledPin, HIGH); // Turn on LED while Emic is outputting audio
while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command
digitalWrite(ledPin, LOW);

while(1) // Demonstration complete!
{
delay(500);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
}
}


and the software serial at attachement
thank u what can I do

Sign In or Register to comment.