0

Possible Duplicate:
pronounce a color based on the bits values with the pic 18f4550.

Hi,

I'm trying to send the binary characters of "RED" to a speaker with a frequency , it is the goal to hear something like RED.

I've put the binary value of red in a decimal value and i need some function to get the first bit of that decimal value , put that in a value and send it to the speaker , than the next bit of the decimal value and so on.

I've been thinking to use a rotate function or something like that but still i'm not succeed.

Anyone who can help me with this ?

Community
  • 1
  • 1
  • Are you asking how get the speaker to say "red" (ie, out loud)? If so, you should look for a "text-to-speech" library (asking for that might produce some useful suggestions if you can't find a good one), though you are unlikely to find one written in assembly. Also, (if so) this question has almost nothing whatsoever to do with compilers; including that tag is likely to reduce your chances of getting a useful answer, and attract downvotes. – David X May 22 '11 at 13:00
  • 2
    This sounds suspiciously similar to this question: http://stackoverflow.com/questions/5859877. – Oliver Charlesworth May 22 '11 at 13:58

1 Answers1

0

You cannot produce the waveform for the word "red" by sending the "binary characters of "RED" to a speaker". You either need to investigate a text-to-speech library or chip, or you need to pre-record an audio waveform (as e.g. raw PCM, or as MP3), and store it in flash/EEPROM, and then decode/replay it on demand.

It is difficult to say anything more specific than this, as you've given no details whatsoever about which PIC family you're using, nor any details about your audio hardware (DAC, etc.).

Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680
  • thank you for your answer , the picdem i use is a PIC18F – Soundcreator May 22 '11 at 15:56
  • @Soundcreator: And what about your audio hardware? What DAC are you using? How is it connected to your PIC? – Oliver Charlesworth May 22 '11 at 15:57
  • eum i've no clue :s , i'm a noob on this can you give some examples ? – Soundcreator May 23 '11 at 11:49
  • @Soundcreator: Without this information, it's impossible to answer the question. You must have a digital-to-analogue converter (DAC) somewhere, that produces an analogue voltage to drive the speaker. This must connect to your PIC somehow. You need to find out the details of this interface, because this completely dictates how your code must work. – Oliver Charlesworth May 23 '11 at 11:53