roboserver-bt.py 文件源码

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

项目:pi-robot-rc-android-bluetooth 作者: grdkly 项目源码 文件源码
def jsonstatus():
    status = {}
    for pin in pinLEDs:
        status[pinLEDs[pin]] = str(GPIO.input(pin))
    status['distance'] = str(round(MeasureDistance() * 100, 1)) + ' cm'
    status['surface'] = BlackOrWhite()
    # JSON encode and transmit response
    response = json.dumps(status)
    client_sock.send(response)
    return

#
# main loop
#

# add serial port service
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号