function  task1() {
     motor.moveRel(1.0)
     return motor.getPosition()
 }
function  task2() {
     motor2.moveRel(1.0)
     return motor2.getPosition()
 }

function  task3() {     
     return sin.read()
 }


//ret = parallelize(task1, task2, task3)

//ret = fork(task1, task2, task3)
//print (ret)
//ret = join(ret)




function moveRelative(args){
    var motor = args[0]
    var step = args[1]    
    print ("Moving " + motor.getName() + " step = " + step)
    motor.moveRel(step)
    return motor.getPosition()
}

ret = parallelize([moveRelative,[motor,1]], [moveRelative,[motor2,1]])
print (ret)
