Shop OBEX P1 Docs P2 Docs Learn Events
Emic and PING? — Parallax Forums

Emic and PING?

roughwireroughwire Posts: 78
edited 2007-04-30 19:53 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-23 17:24
    Read the PING documentation for sample programs that can provide the distance to the first echo in inches, centimeters or millimeters. You can obviously convert this to whatever units you want. The EMIC documentation is full of examples of text to speech. You simply have to use the DEC formatter to convert your distance (in a PBasic variable) into a string of digits as part of a longer message for the EMIC.

    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.
  • roughwireroughwire Posts: 78
    edited 2007-04-23 17:27
    Ah, I think I understand, but not a whole lot. How do I get the emic to read what the debug window pops out?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-23 17:35
    You don't get the EMIC to read what the debug window pops out.

    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.
  • roughwireroughwire Posts: 78
    edited 2007-04-23 17:40
    oh, so...... could you give me a quick drawling or something? I know, I'm really not very bright when it comes to this stuff. Thank you so much.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-23 17:55
    I'm assuming you have copies of the sample programs for the EMIC that you can get from the Parallax webstore page for the EMIC. In the EasyEmic example there's a line like this:
        SEROUT Tx, Baud, [noparse][[/noparse]Say, "Hello world. I am Emic. Hear me roar.", EOM]
    
    


    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:
       SEROUT Tx, Baud, [noparse][[/noparse]Say, "Hello.  Here is a number", DEC 15, ".", EOM]
    
    


    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.
  • roughwireroughwire Posts: 78
    edited 2007-04-23 18:03
    ok but how do I integrate the PING in with that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-23 18:16
    You go back to the sample PING program and get it to produce the same message using the data on the path length that it calculates.

    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
  • roughwireroughwire Posts: 78
    edited 2007-04-25 16:59
    Please!!!!, A diagram would be REALLY REALLY helpful!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-25 17:33
    I don't think I'll have time in the next few days and my home DSL connection is broken. Perhaps someone else will chime in. The word of the day is "experiment". You won't break anything and you'll learn more.
  • roughwireroughwire Posts: 78
    edited 2007-04-25 17:46
    gottcha, Ill see. Oh where do I fing this PING documentation with the text to voice examples?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-25 18:16
    For any Parallax-sold product, you go to their main webpage and navigate to the webstore page for the product. For the PING, you select Accessories on the left side of the page, then, on the Accessories page, scroll down to Sensors, go there and select PING and you'll see the webstore page. At the bottom of the page (as for any of them), there are links to manuals, tutorials, sample programs, etc.

    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).
  • KatyBriKatyBri Posts: 171
    edited 2007-04-25 23:31
    roughwire,

    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.
  • roughwireroughwire Posts: 78
    edited 2007-04-30 18:03
    I just got this program but its not doing what I want! I would be extatic if someone would draw me a diagram. A 3rd grader's drawing in crayons would even be suficient. Please! Help!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    MIKE
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-30 19:53
    There is already a connection diagram in the EMIC documentation. If you've hooked up your Stamp according to the document, the sample program should work. The diagram shows pins 0-3 as being used for the EMIC. The PING documentation shows it connected to pin 15. You shouldn't need any other diagrams to show you how you need to connect both. At this point, both samples programs should work fine and you need to follow my suggestions for combining them. If there's something else you want or something about the demos that doesn't work, you'll have to describe it in detail including what the program does and doesn't do and, if it doesn't behave as expected, exactly what does it actually do?
Sign In or Register to comment.