co.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:PyLetMeCreate 作者: CreatorDev 项目源码 文件源码
def get_measure(mikrobus_index):
    """Measure the CO concentration in the air using the CO click.

    mikrobus_index: must be 0 (MIKROBUS_1) or 1 (MIKROBUS_2)

    Note: An exception is thrown if it fails to communicate with the CO click.
    """
    value = ctypes.c_uint16(0)
    ret = _LIB.co_click_get_measure(mikrobus_index, ctypes.byref(value))
    if ret < 0:
        raise Exception("co click read ppm failed")
    return value.value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号