Is there a variable or method to know when servos have stopped moving? I make my C3PO head talk with the ChatGPT response and using SayEZB and Talk servo 2. Sometimes BingSpeech Recognition hears the wake word again - or at least it thinks it does. So, once I am waiting for C3PO to complete his speech response from ChatGPT, can I pause bing speech recognition? I have tried to do this in the Chat GPT script, but it is not working. Here is my script:
$Response = getVar("$OpenAIResponse"); Digital.set(d0, 1, 0); Digital.set(d1, 1, 0); controlCommand("Bing Speech Recognition", "PauseListening"); Audio.sayEZB($Response); sleep(1000); controlCommand("Bing Speech Recognition", "UnpauseListening");
This does not work because it does not know when EZB is done "speaking" to "UnpauseListening". Also, I have no idea how long ChatGPT will respond- so I can't just use a sleep command. Is there a way I could sense the servos have stopped moving? Any ideas?