Shop OBEX P1 Docs P2 Docs Learn Events
Making EMIC translate properly to English — Parallax Forums

Making EMIC translate properly to English

GuidoGuido Posts: 195
edited 2006-10-20 00:43 in BASIC Stamp
Hi Everyone!!
Me Again. Started playing around with EMIC and trying to make a talking clock......Well I have this problem, it seems EMIC does not like Hours!!!!

SEROUT Tx, Baud, [noparse][[/noparse]say, "The time is " , DEC1 hours , HEX2 MINUTES ,"··· And·· ", HEX2 SECONDS·· , "· Seconds· " ,eom]

With the above, Statement and the time being 1:30:15 seconds, EMIC wants to say 100 instead of one. ( I am using DEC1 just to drop the "0" os 01.....
Any Help would be appreciated.....I did try various spacing etc, but either got EMIC to anouce every number or 100.

Yes Me Again
Guido

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-10-19 23:09
    Guido,

    You need space or punctuation between the numbers that you want to be pronounced separately. The way you have it, the hours and the minutes arive at the EMIC as the string "130", so it is no wonder it says "hundred". Send it "1 30" or "1, 30" so it will parse it into two numbers. Use HEX instead of HEX2 and it will drop the leading zeros.

    SEROUT Tx, Baud, [noparse][[/noparse]say, "The time is ", HEX hours , ", ", HEX minutes, " And ", HEX seconds, " seconds" ,eom]

    Note that hours (hrs), minutes (mins) and AM and PM are in the standard abbreviation dictionary.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • GuidoGuido Posts: 195
    edited 2006-10-20 00:43
    Tracy!!,

    Thank you very much for your help! I do understand now how to sperate the string.....I did have to change a little to give the EMIC a little delay to speak the phrase.....Here is what I came up with!

    SEROUT Tx, Baud, [noparse][[/noparse]say, "The time is " , HEX hours ,", ", HEX MINUTES· ," And· ", HEX SECONDS· , "· Seconds·· " ,eom]··

    I do realaixe that the EMIC has preprogrammed words, but I have not got there yet. Now all I have to do is figure out how to make the clock a 12 hour clock and add the AM/PM bit.......Being new and playing around when I get a chance is great! I really appreciate everyones help.

    Thank You Again Tracy

    Guido
Sign In or Register to comment.