Emic2 code for the propeller
Jim the Hermit
Posts: 79
Can someone post code for the emic2? just a spin file saying a few things.
I got the demo program to work, but I don't know how to change the volume or the voice, pitch, etc.
The demo uses the Parallax Serial Terminal, which I want to get rid of (I successfully hook up my LCD to do the same thing.)
I can't delete pst from OBJ because something called pst#NL gets sent to the emic for some reason.
The emic2 manual has no examples in a computer language as far as I can tell.
I got the demo program to work, but I don't know how to change the volume or the voice, pitch, etc.
The demo uses the Parallax Serial Terminal, which I want to get rid of (I successfully hook up my LCD to do the same thing.)
I can't delete pst from OBJ because something called pst#NL gets sent to the emic for some reason.
The emic2 manual has no examples in a computer language as far as I can tell.
Example:
:V-10
:
Comments
Remember the ":" is what the EMIC 2 returns. It isn't part of the command.
In your example, if you were using PST as a serial device you'd use:
Would set the volume to -10.
And to say "Hello World" use:
The "S" is for "say" or "speak" (I don't remember which).
I'm pretty sure the Emic 2 doesn't care about case.
Have you seen this thread?
Here is an example playing Happy Birthday...
You need some sort of serial driver in order to communicate with the Emic 2. So yes it does take up some RAM but there's not much you can do about it. If you used BST, you can have it remove unused methods which would cut down on the amount of ram used.
Since the Emic 2 communicates at 9600 bps, you could probably get away with using Simple Serial which doesn't launch in a separate cog. I personally think you'll have more problems than it would be worth using Simple Serial though.
If you're going to want to use a debug window, you could use a multi-port serial driver which wouldn't take up much more RAM than the single port driver.
Thanks for your time.
Dave
That would be a very low volume setting. Have you tried "V10"?
I don't recall what the max setting is, but I'm pretty sure it's a positive number.
Did you also send a carriage return?
Edit: The volume range is -48 to 18.
I know I've used the volume setting on my Emic2 without a problem.
One of the things that I tried was to add:
such as: but no luck
Any suggestions?
BTW here is another thread where someone was having the same problem. You posted your code at #5. I tried adding what you did, but still no joy. http://forums.parallax.com/showthread.php/141461-Emic-2-and-Parallax-Terminal
I'm using a pair of earbuds. I don't have a problem hearing anything and I can use the "##" to make it say a word softer. I just can't get it to be louder of softer using
Pst.str(string("v18", 13))
I know that I must be making some small mistake.
I think you're right.
I tried it again just now with the uppercase "V" and there is no difference.
Pst.str(string("V18", 13))
Emic2_Demo2 - Archive [Date 2013.07.10 Time 14.21].zip
I'll test the code soon.
Here's another demo to make it easier to tell if the volume is changing.
The volume gets very loud at 18 and I can barely hear it when it's -30.
Hey Duane, thanks!
I got it working on my set-up. It seems like the key was to break the volume command into three part (two might work, but that's for tomorrow). Changed this: to this:
Thanks again for all of your help and for taking the time in getting out your speaker, setting it up, and making the variable volume demo.
Dave
So the problem was your using the wrong serial line. I didn't notice it until now.
You're right! I changed it to the serial object serial.str(string("V18", 13)) and it works just fine. Details? hu? they make a difference. Thanks again for your help.
Dave
Sometimes those details become invisible from looking at the code so long. Sometimes a second set of eyes helps.
You're very welcome.