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
roboserver-bt.py 文件源码
python
阅读 15
收藏 0
点赞 0
评论 0
评论列表
文章目录