hello guys i use the roll neck with servos not hacked,
in 1412 i used this script with sucess
def neckMoveTo(restPos,delta):
leftneckServo.moveTo(restPos + delta)
rightneckServo.moveTo(restPos - delta)
leftneckServo = Runtime.start("leftNeck","Servo")
rightneckServo = Runtime.start("rightNeck","Servo")
right = Runtime.start("i01.right", "Arduino")
#right.connect(rightPort)
leftneckServo.attach(right, 13)
rightneckServo.attach(right, 12)
restPos = 90
delta = 20
neckMoveTo(restPos,delta)
but now is failing at neckMoveTo :(
can somene help pls
connect ?
Hi Pedro
With a quick look if find two problems, if this is the complete script.
1. You have commented out the connect. That's OK if you connect manually thru the GUI or you do it in some other part of the script. I.e this line:
#right.connect(rightPort)
should be
right.connect(rightPort)
2, If you uncomment the connect, you also need to define a variable so that the script knows what port to connect to. Something like this:
rightPort = 'COM3'
If it's not the complete script, then please send a no-worky
/Mats
mats thanks alot for the
mats thanks alot for the help, but is not that is uncommented and the rightPort was defined before :( but it doesnt mather i burn one ot them for some reason wasnt even atached and burned!!!
so now im using only one and the other as a dummy, so also im not using that script anyway!!
this script used to work, well thanks anyway :)
Hi Pedro In the latest
Hi Pedro
In the latest release of MyRobotLab you can use the publish subscribe pattern to syncronize servos.
Like this:
# Alternative, in case it the offset is in the opposite direction
# leftneckServo.map(0,180,160,-20)