motor API¶
这是自动生成的API文档。把它作为公众的参考项目的API
-
class
motor.
Motor
(i2c=<sphinx.ext.autodoc.importer._MockObject object>)[source]¶ I2C通讯控制驱动电机类
Parameters: i2c – I2C实例对象,默认i2c=i2c -
get_speed
(motor_no)[source]¶ 返回电机速度
Parameters: motor_no (int) – 控制电机编号,可以使用 MOTOR_1
,MOTOR_2
,或者直接写入电机编号。Return type: int Returns: 返回该电机速度
-
MOTOR_1
= 1¶ M1电机常量,0x01
-
MOTOR_2
= 2¶ M2电机常量,0x02
-