Say It Module - asyncrhonously?
mtylerjr
Posts: 5
Hello!
I'm trying to use the "Say It" module - its a nice little package and it seems fairly accurate.
My only problem is that it seems to be only useable synchronously - if it is listening for a match, it is tying up the Micro.
Im using the standard boe-bot, with stamp BS2 - is there any way to continue to do other things, while the say-it module is listening?
For instance, can you even drive servos and have the boe-bot rol continuously, and still be able to command it to stop?
From what Ive seen of the documentation and sample program, you cant do this. Has anyone else made better progress?
Thanks in advance!
I'm trying to use the "Say It" module - its a nice little package and it seems fairly accurate.
My only problem is that it seems to be only useable synchronously - if it is listening for a match, it is tying up the Micro.
Im using the standard boe-bot, with stamp BS2 - is there any way to continue to do other things, while the say-it module is listening?
For instance, can you even drive servos and have the boe-bot rol continuously, and still be able to command it to stop?
From what Ive seen of the documentation and sample program, you cant do this. Has anyone else made better progress?
Thanks in advance!
Comments
Maybe if I added some serial buffers that would store any response, so I could go look for it later... has anyone done that?
Looking further into the docs, it looks like the host has to ack each byte of the response anyway - so perhaps I can write code so that the command is issed, then the code services other tasks, and only then does it pull the response out, just before sending the next "listen" command.
I will restructure things to see if that works!
I was trying to do something more real-time.
Right now, I have a mini rtos that updates the servos continuously, and communicates to a host via bluetooth. I can poll the bluetooth for input, and timeout after a few milliseconds if there is none, and then continue to update the servos so they never slow down, and I can control the bot, turn it, change speeds etc, as it moves continuously, it doesnt need to stop unless I send it a command to stop.
I was trying also add a voice-control aspect to my existing setup, but the problem is that I needed to be able to poll the status of the say-it-module and only wait (use up precious milliseconds during the main loop) if it has a response. I cant wait long or the servos will slow and the bot will stop.
I almost was able to do this, setting the module to use an "unlimited" timeout, then sending a recognize command, and then giving a short (20-30 ms) timeout for the SERIN command to get responses, checking the module each time through my main loop to see if it has recognized anything - but this seems to only work sometimes - using the SERIN command that frequently, while the module it is in recognize mode, seems to but hit and miss as far as getting the response. Sometimes it works, sometimes it doesnt.
I think the say-it-module would be infinitely more useable, especially in a real-time way, if it simply provided a signal on one of its unused pins, driving it high when it has a recogniztion response, so all you would need to do is send a command, then just check the status of that pin/signal from time to to time to see if a command has been recognized, before asking for the response. That way, you wouldnt need to waste precious milliseconds waiting for a SERIN timeout if there is no response yet.
Then it could be used in a much-more real-time way.
For now, to do what I want to do, I am actually going to mount a second board (a spare homework board) on top of the BOE, as a second level, that will handle just the voice-activation part - so when a command is recognized, I can just set a signal pin, and then the lower BOE board itself can just check this signal , and only react when a command is recognized. I need to use dual processors to do what I need, basically, with one dedicated just to handling the say-it-module.
Who makes the say-it-module, anyway? Is it a parallax-specific product? Just adding a "response ready" signal on a spare pin would make it very much more useful in a real-time environment, imho.
In any case, it is a cool little module, despite the limitations. I am having a lot of fun with it, and I definitely think it was worth the money