用脚本控制电机

2018-03-13  本文已影响0人  ww4u
# -*- coding=utf-8 -*-

# step1
import mrq.mrq as MRQ
# from mrq import *

# step2 
# create the device
myMrq = MRQ.MRQ( "device1" )
# step3
# read the idn
idn = myMrq.IDN 
print( idn )

# step4 
# control the device
myMrq.IDENTITY_DISTDEVICE = "ON"

# get the value
idDist = myMrq.IDENTITY_DISTDEVICE
print( idDist )

# control the motor
# loop
for i in range( 1, 100 ):
    myMrq.roate( 0, 360 )
    myMrq.wait_idle( 0 )

    myMrq.roate( 0, -360 )
    myMrq.wait_idle( 0 )
上一篇 下一篇

猜你喜欢

热点阅读