How can I make the Boe-Bot say(in debug terminal)
DEBUG "Hi, I'm Boe. What's your name?"
Then be able to type in your name, and have it say
"Hello ----"
line, I guess it would complain. Sorry, I should have mentioned I was only replacing the 'MAIN: ... GOTO MAIN' part, with the MAIN2: ... GOTO MAIN2 part -- you still needed the variable declarations as given above.
And Jon: yes, usually I refrain from the "have you read the manual on this?" comment, because sometimes people HAVE read the manual, they just didn't 'get it'. Even then, I'll try to give a helpful answer after that. Sigh.
C1 and C2 are labels in a schematic.· C usually stands capacitor and R usually stands for resistor.· Sometimes you'll see:
C1 = 5pf
C2 = 3300uf
R1 = 10K
R2 = 220ohm
It's important to be able to read a schematic when putting together a project correctly.· There are of course other labels that I have not listed.· You definitely·want to read up on some basic electronics to give yourself a better understanding of electronics.· It is always a good practice to ask questions before damaging your circuit, it will save you money and head aches in the long run.
All,
From reading this and another similar thread from Jimmio, it sounds as though he is expecting the Stamp to "say" the string...unfortunately without the benefit of any help.
Jimmio,
Producing sound with a microcontroller is generally not a difficult thing, but speech is a whole different ball of wax. Typically, a speech "outputter" consists of some kind of tone generator...if you've ever seen someone who has had throat surgery and has to use a "voicebox" against their throat to speak, then you get the idea...it's nothing more than a device to produce a hum somewhere in the "normal" range of speech frequencies. This tone then goes through a "voicebox simulator" that shapes the tone into the various allophones that we use in speech, sometimes by simple manipulation of the frequency and sometimes by adding "noise" (for the sibilants, fricatives, and all of those other funny-sounding words) and sometimes by magic <g>. In the case of the afore-mentioned surgery recipient, their own throat and head perform this function on the tone from the handheld unit.
On top of this, there is also a piece that converts the ASCII text (what you see in the DEBUG window) into a string of allophones for the processor to enunciate..this is a science that is "interesting" (and not always entirely successful) to say the least.
With the above in mind, you should be getting the message that the Stamp, with its limited speed and memory space, is not capable of performing these tasks without some outside help. I would recommend the EMIC module that Parallax sells.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
I have this code. How can I make it so it will follow commands?
' {$STAMP BS2}
' {$PBASIC 2.5}
ReadName VAR Byte(10) ' Allocate 10 bytes for 'string'
I9600 CON 84 + 16384 ' 9600 baud is 84, Inverted is 16384
ReadAction VAR Byte(10)
Main2:
DEBUG "Hi, I'm BOE. What's your name?", CR
DEBUGIN STR ReadName\10\13 ' Read 10 bytes, or to CR
Main3:
DEBUG "Hello ", STR ReadName ,CR
DEBUG "What would you like me to do?", CR
DEBUGIN STR ReadAction\10\13
DEBUG "So you want me to: ", STR ReadAction ,CR
DEBUG "I'm starting your request",CR
DEBUG "PLEASE WAIT",CR
PAUSE 5000
Now you're pushing too far ... you will not be able to do text processing as your code suggests.· What you could do is accept single-character commands: F (forward), R (reverse), L (left), R (right), etc.·
Here's a snippet of code that will handle upper- and lowercase letters:
Comments
' {$PBASIC 2.5}
ReadName VAR Byte(10) ' Allocate 10 bytes for 'string'
I9600 CON 84 + 16384 ' 9600 baud is 84, Inverted is 16384
Main:
SEROUT 16, I9600, [noparse][[/noparse]"Hi, I'm BOE. What's your name?", CR]
SERIN 16, I9600, [noparse][[/noparse]STR ReadName\10\13] ' Read 10 bytes, or to CR
SEROUT 16, I9600, [noparse][[/noparse]"Hello ", STR ReadName]
GOTO MAIN
-- or --
Main2:
· DEBUG "Hi, I'm BOE.· What's your name?", CR
· DEBUGIN STR ReadName\10\13· ' Read 10 bytes, or to CR
· DEBUG "Hello ", STR ReadName
· GOTO MAIN2
Post Edited (allanlane5) : 4/18/2005 7:15:25 PM GMT
HOW DO I MAKE IT STOP?!?!?!?!?!?
Suggestion 1: Read the manual.
Suggestion 2:
Main2:
DEBUG "Hi, I'm BOE. What's your name?", CR
DEBUGIN STR ReadName\10\13 ' Read 10 bytes, or to CR
DEBUG "Hello ", STR ReadName
STOP
Note you are using a micro-processor, now. Usually you WANT a 'main' infinite loop to continue processing.
DEBUGIN STR
ReadName does not work
"Expected a byte variable"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
ReadName VAR Byte(10)
line, I guess it would complain. Sorry, I should have mentioned I was only replacing the 'MAIN: ... GOTO MAIN' part, with the MAIN2: ... GOTO MAIN2 part -- you still needed the variable declarations as given above.
And Jon: yes, usually I refrain from the "have you read the manual on this?" comment, because sometimes people HAVE read the manual, they just didn't 'get it'. Even then, I'll try to give a helpful answer after that. Sigh.
The goal here is to capacitively couple the AC signal to the speaker, while filtering any DC component. That's what the capacitors do for you.
C1 and C2 are labels in a schematic.· C usually stands capacitor and R usually stands for resistor.· Sometimes you'll see:
C1 = 5pf
C2 = 3300uf
R1 = 10K
R2 = 220ohm
It's important to be able to read a schematic when putting together a project correctly.· There are of course other labels that I have not listed.· You definitely·want to read up on some basic electronics to give yourself a better understanding of electronics.· It is always a good practice to ask questions before damaging your circuit, it will save you money and head aches in the long run.
Dave·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
www.parallax.com
·
From reading this and another similar thread from Jimmio, it sounds as though he is expecting the Stamp to "say" the string...unfortunately without the benefit of any help.
Jimmio,
Producing sound with a microcontroller is generally not a difficult thing, but speech is a whole different ball of wax. Typically, a speech "outputter" consists of some kind of tone generator...if you've ever seen someone who has had throat surgery and has to use a "voicebox" against their throat to speak, then you get the idea...it's nothing more than a device to produce a hum somewhere in the "normal" range of speech frequencies. This tone then goes through a "voicebox simulator" that shapes the tone into the various allophones that we use in speech, sometimes by simple manipulation of the frequency and sometimes by adding "noise" (for the sibilants, fricatives, and all of those other funny-sounding words) and sometimes by magic <g>. In the case of the afore-mentioned surgery recipient, their own throat and head perform this function on the tone from the handheld unit.
On top of this, there is also a piece that converts the ASCII text (what you see in the DEBUG window) into a string of allophones for the processor to enunciate..this is a science that is "interesting" (and not always entirely successful) to say the least.
With the above in mind, you should be getting the message that the Stamp, with its limited speed and memory space, is not capable of performing these tasks without some outside help. I would recommend the EMIC module that Parallax sells.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
' {$STAMP BS2}
' {$PBASIC 2.5}
ReadName VAR Byte(10) ' Allocate 10 bytes for 'string'
I9600 CON 84 + 16384 ' 9600 baud is 84, Inverted is 16384
ReadAction VAR Byte(10)
Main2:
DEBUG "Hi, I'm BOE. What's your name?", CR
DEBUGIN STR ReadName\10\13 ' Read 10 bytes, or to CR
Main3:
DEBUG "Hello ", STR ReadName ,CR
DEBUG "What would you like me to do?", CR
DEBUGIN STR ReadAction\10\13
DEBUG "So you want me to: ", STR ReadAction ,CR
DEBUG "I'm starting your request",CR
DEBUG "PLEASE WAIT",CR
PAUSE 5000
DEBUG "ERROR: incorrect wording of command",CR
DEBUG "Starting over...",CR
GOTO Main3
Here's a snippet of code that will handle upper- and lowercase letters:
Get_Cmd:
· DEBUGIN cmd
· LOOKDOWN cmd, [noparse][[/noparse]"fFrRlLrR"], cmd
· IF·(cmd > 7) THEN Get_Cmd
· cmd = cmd / 2
· ON cmd GOSUB Go_Fwd, Go_Rev, Go_Left, Go_Right
· GOTO Get_Cmd
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA