Emic and PING?
roughwire
Posts: 78
Is there a program out there that will allow me to make my boe bot verbaly display the mesurements of distance that the PING program shows? You know, one of the programs they give you is the ' measuring distance with the PING '. I love this program, but instead of reading it on my PC, I want it to go around saying the legnths of stuff. I've got the PING (w/out bracket), and EMIC (female). What can I do?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
Comments
As usual with this kind of thing, start with the sample programs. Get the PING to format a message on the Debug Window that the EMIC would like, then take the EMIC sample program and modify that so you can get the EMIC to say what you want, then combine the two programs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
If you have a SEROUT statement that sends the string you want to the debug window, you just have to change the pin number to send the same thing to the EMIC. Remember that "pin # 16" is used to designate the programming serial port rather than a regular I/O pin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
For experimental purposes, you'd set Tx to 16 and Baud to 9600 earlier in the program. You'd also comment out the "GOSUB Check_Busy".
This would display the "Hello world ..." text in the debug window about every 2 seconds. The "Say" and "EOM" will probably show up as
garbage in the display window and you can ignore that.
Now you can substitute other text for the EMIC in the SEROUT statement and you can include numeric stuff. An example might be:
Look at the EMIC documentation and the other sample program for examples of what can be said. Once you've got this going, you can
try it with the EMIC by changing the Tx and Baud definitions back to what they need to be for the EMIC and uncommenting the GOSUB.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
Look, the PING sample program just produces a variable value. You just need to "say" that value and the EMIC sample program gives you a way to do that. You just need to combine the two programs. It's much easier done than described. You have two tasks:
1) Trigger the PING and translate the resulting value into a number in a variable
2) Take the number in a variable and use the EMIC to "say" it as part of a longer message
You will take two sample programs each of which does one of these tasks. Then you will take the two programs and put them together.
In the process, you will hopefully understand how each of these sample programs work and, if so, it should be fairly simple to see
how they work together. I'm not going to do the work for you. You won't learn that way. If you get hung up along the way, ask
a specific question and I (or someone else) will give you a specific answer. Try things and try not to make things more complicated
than they really are. Microcontrollers, the Stamps in particular, are pretty simple. You can get fancy with them, but you don't have to.
Post Edited (Mike Green) : 4/23/2007 6:20:51 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE
The PING doesn't have text to voice examples, but, on the EMIC page, you'll find some sample programs. One is a fairly complete example that exercises most of the capabilities of the device. You'll see some sample text messages that include numbers. READ THE DOCUMENTATION IN THE COMMENTS! Particularly beware about adding phrases (the documentation explains that thoroughly).
I am also developing an application with an EMIC. There are two demo examples on the Parallax web site (EMIC product page).
You should use the one entitled "EMIC_TTS.BS2". It sets the reset line correctly and works.
You should NOT use the"EasyEmic.BS2" demo program. It is there for code info only.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MIKE