Y_PREV = 0 ' memorize position of motor C For X=1 To 360 ' move steps of single degrees Y = 50*Math.Sin(X/180*Math.PI) ' calculate Y dependent of X Y = Math.Round(Y) ' rounding (motor can only go to integer values) Y_INC = Y - Y_PREV ' calculate the distance from current to new position Y_PREV = Y ' memorize the new position for next iteration Motor.SchedulePower("A",30,0,1,0,"true") ' move A by one degree If Y_INC>0 Then ' move motor C either forward Motor.SchedulePower("C",30,0,Y_INC,0,"true") Else ' or backwards Motor.SchedulePower("C",-30,0,Y_INC,0,"true") EndIf Motor.Wait("AC") ' wait until both motors have reached the position EndFor