
Redzone
USA
Asked
— Edited

Hello, I had a working JAW/mouth working with older software. I upgrade to the lastest software and can't figure out how to sync the jaw using a analog to digital from my PC to the power amp that goes to the ADC0. I can't figure out how to make it work using the new software.
This is what I had using the older software for the jaw sync...If (ADC(ADC0) > 1) servo(d4,48) sleep(10) release(d4) endif
Any help would be nice.
Thanks, Mike
Improvements including a firmware update to the V3 which makes it a lot better. It's worth keeping the software up to date.
hi rich. I updated the software and I used your commands I need to tweak it a little and it seems to work. not quite as good as I'd like i need to figure that out. I did try PC servo sound but when you talk the mouth moves. so I am using your script now but like I said I need to tweak it. I may have more questions down the road but thank you both very much. Mike
To be honest, when I read the code I didn't expect it to be how you wanted it. The principals of the code should remain though (i.e. the loop label and goto, the ADC part etc.). It's probably the actual movement that you aren't satisfied with but that's simply a case of adding in more steps in the code, possibly adding in more conditions for the If...
I wont re-write the code as I don't know the specifics and I'd like for you to try yourself, it'll be more rewarding. But if you do need more help just shout, that's what I'm here for
Hi Rich,
You're right about more rewarding. However, I've been working on the jaw sync for 8 hrs and it makes my head hurt. I just don't understand programming and the logic. Do you mind giving me more examples please? If you need more info please let me know. Thank you!
It would be great if I could get the jaw sync like the inmoov robot jaw does.
Hi again.
Here is what I have so far. :loop adc_wait(adc0, higher, 0) servo(d4,45) sleep(50) release(d4) if (getadc(adc0) < 1) servo(d4,80) endif goto(loop)
It works some what, but it moves when there is no sound out of the speaker
Sorry I posted before I was finished. The d4, 45 opens the jaw and the d4, 80 closes the jaw.
When the sound is playing does the ADC value vary with the volume? I assume so however I'd like to know for sure as it could make the scripting quite different.
One method would be to write a script that just loops around the movement of the jaw, moving the servo from position 45 to 80 to 45 to 80 etc.
Then have another script which checks the ADC value with either an If(GetADC(ADC0) > 1) or with an ADC_Wait command. Once the ADC value change is detected then use a ControlCommand to start the movement script. When the ADC value is 0 (or below a small tolerance) use the ControlCommand to stop the movement script.
You may also be able to use the Auto Position control and set up a few different frames and actions which can be started and stopped with ControlCommand.
So have something like these;
Movement Script
Detection Script
If your ADC value varies with volume you could have a bunch of IFs in the movement script which check the ADC value and move the servo to a different position. You could use the random number command to adjust the sleeps for random gaps to make it look a bit more realistic. There are a number of things you could do to improve the motion which I'll cover if you need it once you get the actual detection and starting of the movement sorted.
Note: it's 3:40am here, I haven't been to sleep in almost 24 hours now, I apologies if my code has any errors but if it does just check the EZ-Script manual and correct them