激光测距模块/Distance

Methods

(static) getDistance(moduleIndex) → {Promise.<float>}

Source:
获取检测的距离值(cm)
Parameters:
Name Type Description
moduleIndex int 模块序号
Returns:
距离值,范围 0~100 cm
Type
Promise.<float>

(static) getFirmwareVersion(moduleIndex) → {Promise.<int>}

Source:
获取当前模块版本号
Parameters:
Name Type Description
moduleIndex int 模块序号
Returns:
Type
Promise.<int>

(static) setOnboardRGB(moduleIndex, rgb)

Source:
设置板载LED的颜色
Parameters:
Name Type Description
moduleIndex int 模块序号
rgb int '红': 1,'绿':2,'蓝':3,'浅蓝':4,'黄':5,'紫':6,'白': 7,'不亮': 8

(static) regDistance(moduleIndex)

Source:
注册检测的距离值上传,当检测的距离值改变会接收到数据,返回类型为float
Parameters:
Name Type Description
moduleIndex int 模块序号

(static) unregDistance(moduleIndex)

Source:
注销距离值上传
Parameters:
Name Type Description
moduleIndex int 模块序号