Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Hong Kong
Asked — Edited

How To Control Servo Moving When Play Music Or Audio?

Hi,

Anyone can help to control the servo moving during play music? EZB4 have a talk servo function for text speech. But how about the music or audio?

I have tried the Sound board(PC) and Sound Servo(PC Speaker) to play the Music file, then the sound servo screen have a wave form, but the servo motor is not active(It already set min. & max number).

Pls. note the attached picture for ref.
User-inserted image


Can anyone help to answer this question?

Thanks a lot!;)

United Kingdom
#1  
"Soundboard EZB" will do what you want.

http://www.ez-robot.com/Tutorials/Help.aspx?id=199

But if you want to use the "Soundboard PC" and "Sound servo (PC speaker)", you can use a simple script. Add an "Ez-Script" control to your project, and, as an example, add the following example script...

Code:

#Assuming servo is connected to port D0

loop
if($SoundValue >30)
Servo(D0,180)
Sleep(500)
elseif($SoundValue <29)
Servo(D0,1)
Sleep(500)
endif
sleep(100)
goto(loop)


When the sound level goes above 30, the servo will move to position 180.
When the sound level is below 29, the servo will move to position 1.
Play with the "Update Speed" and "Scalar" settings, and the servo positions and length of sleep()'s in the script to suit your needs.
#2  
Hi Steve

Thanks your help again:D

Yes, I have copy & paste your script to EZ-script, but it pop up the message...
Pls. see the picture file.

User-inserted image


And I have try to use the Sound board EZB & press the edit button, it is not show the wave form and pop up error message.. why?
Pls. see the picture file.:(

User-inserted image


So depression....:(
PRO
Portugal
#3  
Hi, in line 3 of the code it should be ":loop" not "loop"
United Kingdom
#4  
Sorry, typing error. That should be...

Code:

:loop
#5  
Hi Steve & Proteusy,

Thanks a lots!

So, do you know what wrong with my sound board ezb problems?

My music is MP3 and then import and press the edit button, it can not shown the wave form and pop up the error message box!

Appreciated for help!;)
#6  
@rickymahk2013

Post your project with the soundboard EZB in it so one (or more) of us can test. I suspect we might have another locale/internationalization issue, but I am not sure. Would like to see what the error message is saying in English if the problem is duplicated on US systems. Can you tell us what that error message is saying?

Might be good to make a zip file and also include the MP3 you are using, so we can see if it is an issue with the music file itself.

Alan
#7  
Hi Alan,

Yes, I will do that before Sat! Thanks for your reply and help!;)
#10  
Hi DJ,

Great! it work normally now!

Thanks a lot!;)