driver.py 文件源码

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

项目:CatLaser2 作者: adafruit 项目源码 文件源码
def on_message(client, userdata, msg):
    # Called when a MQTT message is received.
    print('{0}: {1}'.format(msg.topic, str(msg.payload)))
    # Handle a target request.
    if msg.topic == TOPIC_TARGET:
        # Try to parse out two numbers from the payload.  These are the
        # screen x and screen y coordinates for the target command.
        result = parse.parse('{:d},{:d}', msg.payload.decode('ascii'))
        if result is not None:
            # Got a valid pair of numbers, use the laser model to target that
            # position.
            model.target(result[0], result[1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号