Asked — Edited

Relative Servo Scripting

Hi All.

I need some help on how to write a script utilizing 2 servos in the relative servo mode. I played around with the non-script relative servo function and it seems to be able to do what I want, though it needs some limits:

The robot dog's ears (see my avatar) need to rotate quickly back and forth about 30 degrees or so. One turns clockwise while the other is counterclockwise, so the relative servo feature seems to be what I need.

When the script is called (eg by voice command or other function), he'll need to wiggle his ears 4 times.

many thanks in advance,

Frank


ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

PRO
Synthiam
#1  

I don't think you need relative servo.. Create an EZ-Script Control, or a new EZ-Script in the Script Manager...


$x = 0

:loop

servo(d0, 20)
servo(d1, 20)
sleep(500)

servo(d0, 70)
servo(d1, 70)
sleep(500)

$x++

if ($x = 4)
  Halt()
endif

goto(loop)

And you can start that script anytime from another script or command. When editing the EZ-Script within a Speech Recognition, Joystick, or WiiMote... Simplyl press the "Cheat Sheet" tab and it will show you all available commands. Select the command by clicking on it and it will insert the code into your script window:)

#2  

Thanks-- I got it to go with a voice command 'wiggle your ears'! This will be so cool!

Frank