2020
09-28
09-28
python轮询机制控制led实例
我就废话不多说了,大家还是直接看代码吧!#-*-coding:utf-8-*-#File:ceshitianqiimporturllib2importjsonimporttimeimportdatetimeimportserialimportrandomimportosimportsysAPIKEY='ZPdLyl***='#改成你的APIKEYser=serial.Serial("/dev/ttyUSB2",9600,timeout=1)defread(key):ser.write(key)print("output:"+key)time.sleep(1)response=ser.readall()print(response)print(type(response))...
继续阅读 >