SayIt Module - Program Help
dehlen
Posts: 13
Hey, i have a SayIt Module and the downloadable standard program is working fine.
Anyway i want to have the following commands:
Move forward X feets (0-10)
Move backward X feets(0-10)
Move left X feets (0-10)
Move right X feets (0-10)
Turn left 90,180,270,360 degrees
Turn right 90,180,270,360 degrees
Spin around
Go in Detection Mode
Actually i am very new to PBASIC and i don't know how to program this. I always get an error that my eeprom is full, because my code is very dirty i think.
Could be someone so kind and tell me how to program this ?
Thanks so much.
Anyway i want to have the following commands:
Move forward X feets (0-10)
Move backward X feets(0-10)
Move left X feets (0-10)
Move right X feets (0-10)
Turn left 90,180,270,360 degrees
Turn right 90,180,270,360 degrees
Spin around
Go in Detection Mode
Actually i am very new to PBASIC and i don't know how to program this. I always get an error that my eeprom is full, because my code is very dirty i think.
Could be someone so kind and tell me how to program this ?
Thanks so much.
Comments
this will involve a lot of voice recording and code portions.written, as there will be so many options. Unfortunately you cannot load a variable with this unit as I assume from your post you wish to do.
Wordlist 1: Move, Turn
Wordlist 2: Forward, Backward, Left, Right
Wordlist 3: 1,2,3,4,5,6,7,8,9
I have to make i this way: ??
Move Forward 1
Move Forward 2
......
Move Backward 1
....
?
you have to recvord and write all the necessary code and wordlists for all the options you feel you need and it maybe that's why you are running out of space?
I don't know how to fix that. I mean look at the link i posted. There is a guy who succeeded with this, so there must be a way to get this working.
You first group of wordlists if the way the SayIt works. You need to program the BS to switch wordlists though.
Usually you'd start with the SayIt listening for the trigger word "Robot". Once it hears "Robot" it knows to listen for more commands.
In you example, when "Robot" is heard, the BS would then switch the SayIt's wordlist to #1. While listening for words in wordlist #1, if the SayIt hears "Move", then your program would switch to wordlist #2 and listen for the direction. Once the direction is heard, the BS would switch the SayIt to wordlist #3 to determine how much to move.
The main thing about all this is the SayIt itself isn't very smart. It doesn't know when to switch to different wordlists on its own; it needs the BS to tell it which wordlist to use.
I see you're new to the forum. Welcome. Have you programmed your robot without the SayIt much? You want to make sure you know how to program the robot to do all these tasks without the SayIt before adding the complication of using the SayIt module as an input device.
You mentioned you're new to PBASIC. You might want to get a little more comfortable with programming before adding the SayIt.
It will also help us help you if you post the code you're working on. Phil made a little tutorial on how to use code tags. Here's the link.
Then i say the direction and this works fine too and i set VRGROUP = 3 so he listens for the distance variable. But then i think i have to much cases and thats why my eeprom is full.
Wait a minute i will write the code again like i had it and will post it here.
Thanks again !
The voice recognition unit talked direct to his laptop whereas the Sayit talks via the boe, you may be able to read the serial data from the sayit into your pc but you would have to write some pc code to utilise this and then send the appropriate command back to the boe-bot.
of course this could be achieved with a mic and voice recognition software also.
Of course instead of the DEBUG commands i would move the robot but for test purposes this is my code. Anyway i always get "eeprom is full" i think because of this high number of CASE commands.
I just looked at the post you linked to. He was using a computer for the speech recognition. The computer was only sending three variables to the robot. His setup doesn't put much of a burden on the BS2.
I do think the BS2 will be able to use the SayIt to control the BOE-Bot. It might take some careful programming not to use up all its EEPROM. I personally don't program Basic Stamps any more (I'm a Propeller fan) but there are lots of other forum members who could help you squeeze your code into a BS2. I'd suggest starting simple and then add more advanced features once you have the simple stuff working correctly.
Anyway how could i complete this ?
One thing I noticed was all the strings. Strings take up a lot of memory.
Instead of
use
You could alternatively have the string
stored only a single time and reuse it in your debug statements and just add a unique ending as needed. I don't know how to do this with a BS2 but I bet others around here do.
I bet there are other memory saving tricks that would help reduce the size of your code. Hopefully other forum members will point them out.
I still think the BS2 can handle this project just fine (without needing a PC). Of course there will be a limit on how many tasks the BS2 can store, but I bet you could get your BOE-Bot to do a lot of stuff if you're careful with your programming.
Otherwise it's a case of going down the route like in the link you posted.
Do you mean hacking the SayIt's firmware?
The SayIt will work fine independent of the PC. You don't even need a PC to program in custom words. The PC software for the SayIt just sends serial commands to the SayIt module (via the bridge program). A microcontroller could also send these same commands. The PC software just make it more convient to program the custom words in the SayIt by letting the user interact with an easy to use GUI that takes care of sending the proper serial commands for you.
The PC software also generates a PBASIC template to help get you started with the programming process. The template isn't very smart. The user still needs to do a lot of work to make a useful PBASIC program from the template.
This is a great project. The BS2 can do this! It will only need the PC for editing and loading the program. It will not be dependent on the PC when it's roaming around listening for your commands. (Because of servo noise, the BOE-Bot might need to be standing still to hear commands.)
The suggestion to hack the firmware was so that it could be used like the speech recognition unit he posted in his link, as it stands the Sayit would not be able to do what he wants unles he cuts back on his command list.
I check the cases and for example i am in the case forward 1 feet. So i write in this case GOSUB MForward
The MForward Method looks like this:
And the Forward method like this:
But how does the method MForward get the value for var3 ?
Thanks !
Really? You don't think a BS2 could handle these commands?
I just find that hard to believe. As I mentioned, I don't use Basic Stamps anymore but I still think the BS2 could handle this project.
Any other BS2 users around that have an opinion about this? Chris, Mike, Tracy, erco, PJ?
You will have to record a command for each value of var 3 to do something for each option you would fill in the program code in the template, it's laborius but i'm afraid it's the only way
So to summarize you would have forward code for 1 foot, 2 foot, 3 foot etc.......
you could get the relevant code to say that var 3 is this value but it would still probably have the same amount of commands and code snippets to achieve the same result.