AdolphSmith

10 years 5 months ago

arduino = Runtime.createAndStart("arduino","Arduino")
arduino.connect("COM14")
 
s1 = Runtime.createAndStart("s1","Servo")
s2 = Runtime.createAndStart("s2","Servo")
s3 = Runtime.createAndStart("s3","Servo")
s4 = Runtime.createAndStart("s4","Servo")
s5 = Runtime.createAndStart("s5","Servo")
s6 = Runtime.createAndStart("s6","Servo")
s7 = Runtime.createAndStart("s7","Servo")
s8 = Runtime.createAndStart("s8","Servo")
s9 = Runtime.createAndStart("s9","Servo")
s10 = Runtime.createAndStart("s10","Servo")
s11 = Runtime.createAndStart("s11","Servo")
s12 = Runtime.createAndStart("s12","Servo")
s13 = Runtime.createAndStart("s13","Servo")
s14 = Runtime.createAndStart("s14","Servo")
s15 = Runtime.createAndStart("s15","Servo")
s16 = Runtime.createAndStart("s16","Servo")
s17 = Runtime.createAndStart("s17","Servo")
 
s1.attach("arduino",24)
s2.attach("arduino",25)
s3.attach("arduino",97)
s4.attach("arduino",27)
s5.attach("arduino",28)
s6.attach("arduino",29)
 
 
def rest():
s1.moveTo(90)
s2.moveTo(171)
s3.moveTo(90)
     s4.moveTo(77)
     s5.moveTo(168)
     s6.moveTo(105)
def move1():
s1.moveTo(90)
S2.moveTo(171)
s3.moveTo(90)
s4.moveTo(60)
s5.moveTo(100)
s6.moveTo(100)
 
for x in range(0, 3):
# do a gesture
rest()
# wait for a second
sleep(1)
# do another gesture
move1()