.. module:: parrot :synopsis: mPython expansion board driver :mod:`parrot` --- mPython expansion board driver ================================================== .. figure:: /_static/products/ledong-v2/_static/image/extboard/extboard_back.png :width: 600 :align: center The mPython expansion board parrot is derived from the mPython Board. It is compact and easy to carry. It is an IO pin expansion board that supports motor driving, voice playback, speech synthesis and other functions, and can expand 12 IO interfaces and 2 I2C interfaces. This library provides motor driving, LED driving and other functions for the mPython expansion board. Motor control I2C communication protocol data format: ============= ======== =========== ============ Type Command motor_no speed(int) Motor control 0x01 0x01/0x02 -100~100 ============= ======== =========== ============ *When 'speed' is negative, it reverses; when positive, it rotates forward.* -------------------------------------------------- .. automodule:: parrot :members: :member-order: bysource .. literalinclude:: /_static/products/ledong-v2/_static/examples/mpython-shield/motor_simple.py :caption: Motor driving example :linenos: .. literalinclude:: /_static/products/ledong-v2/_static/examples/mpython-shield/ir_send.py :caption: NEC-encoded infrared transmitting example :linenos: .. literalinclude:: /_static/products/ledong-v2/_static/examples/mpython-shield/ir_learn.py :caption: NEC-encoded infrared learning example :linenos: