Makeblock-official / PythonForMegaPi

python for MegaPi with Raspberry Pi
http://openlab.makeblock.com
49 stars 26 forks source link

Encoder motor: how to specify the port? myboard was megapi #9

Closed DengkeDu closed 6 years ago

DengkeDu commented 6 years ago

Hi For encoder motor, the encoder motor function doesn't contain port, so can I insert it to any port that color match?

DengkeDu commented 6 years ago

Does the following function working on megapi? encoderMotorRun(self,slot,speed)

YanMinge commented 6 years ago

All there API support:

encoderMotorRun( port, speed )
encoderMotorMove( port, speed, distance, def onFinish )
encoderMotorMoveTo( port, speed, position, def onFinish )
encoderMotorSetCurPosZero( slot )
encoderMotorPosition( slot, def onResult)
encoderMotorSpeed( slot, def onResult)