djjon1976
Australia
Asked
Hi all.
Is there anyway of having a servo randomly do stuff? Almost like a demo situation? So the robot just sits there and moves his head, or says something random.
Thanks all.
Jonno
There is a skill in ARC called "Personality Generator" It does just what you are asking for. I use it for my robot and it works great.
You can find all about it and how to install and use it here: ARC Personality Generator Skill
Have fun!
hi dave &djjion
if you are using the jd robot.here is an excample for starting . make sure you dont past the limit of the d1 servo cause of the neck braket hits the body. you can play with the sleep to get better results. servospeed ,the higher the number the slower , the movement .
servospeed(d0,2) servospeed(d1,2) :loop sleep(300) servoRandom(d0,70.120) sleep(400) sayezb("make the world great again") sleep(300) servoRandom(d1,70,90) sleep(300) goto(loop)
Cheers all!
Will have a play tonight.
This would work as well - it's for javascript so it's faster
*Edited for lowercase sleep() as per javascript manual (https://synthiam.com/Support/javascript-api/javascript-overview)
Cheers DJ.
However, when i use the code i get a "sleep not is defined" error in the script runner.
Any ideas?
Jonno.
djjon1976
you can copie the code straight from this topic .from dj .
Have you changed you script editor from EZ Script to Javascript? You can do that at the top of the editor when you go into the control to write your script.
Hi all.
Yeah copied the text directly and switched to Javascript. It does actually run the code, but i still get the error.
Hello @djjon1976
It's likely because Sleep has a capital S, make it lower case
Jeremie is correct - I typed it on my phone and it must have been auto capatlized. Here's the manual for Javascript: https://synthiam.com/Support/javascript-api/javascript-overview
Otherwise, since you may be new to programming - the Blockly might be easiest for ya. Here's a sketch to do what you want...
That fixed it!
Cheers all.