So lately I have been trying to get my new EMIC 2 to talk to me the text I type to it using my Arduino.
But as you can probably tell due to this topic, I have had no luck.
I have been using the example code given, it says its start up text which is written in the code but does not allow me to give it any text I type to it.
I have tried using all the possible ":s", ":n", ":h" ect code with no effect.
not sure if this is important or not but it does not send anything to the serial window (not even sure if it is meant to).
Any help on this would be great. Also I will include the sample code so you don't have to look for it.
What I fear the most is that this code does not allow for user input, if so could someone help me with one which does.
Kind Regards,
Miget
(No don't read my name as Midget)
Code: Select all
/*
Emic 2 Text-to-Speech Module: Basic Demonstration
Author: Joe Grand [www.grandideastudio.com]
Contact: [email protected]
Program Description:
This program provides a simple demonstration of the Emic 2 Text-to-Speech
Module. Please refer to the product manual for full details of system
functionality and capabilities.
Revisions:
1.0 (February 13, 2012): Initial release
*/
// include the SoftwareSerial library so we can use it to talk to the Emic 2
#include <SoftwareSerial.h>
#define rxPin 2 // Serial input (connects to Emic 2 SOUT)
#define txPin 3 // Serial output (connects to Emic 2 SIN)
#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
intialize. 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('\n'); // Send a CR in case the system is up
while (emicSerial.read() != ':'); // Wait for ':' character
delay(10); // Short delay
emicSerial.flush(); // Flush the receive buffer
// Set volume to 12
emicSerial.print("V12\n");
while (emicSerial.read() != ':'); // wait for ':' character
// Speak some text
emicSerial.print('S');
emicSerial.print("Hello. This ");
emicSerial.print("is the EMIC 2, text to speech module. I am easy to use, ");
emicSerial.print("just send me a text string and i will speak it for you.");
emicSerial.print('\n');
while (emicSerial.read() != ':'); // Wait for ":" character
}
void loop() // Main code, to run repeatedly
{
//do nothing
}