电路实验3-pc通过串口控制小灯
附上代码:
import serial,time
s =serial.Serial('com4')
#s.setRTS(1)
i=0
while 1:
i=not i
s.setDTR(i)
time.sleep(.5)
s.close()
附上代码:
import serial,time
s =serial.Serial('com4')
#s.setRTS(1)
i=0
while 1:
i=not i
s.setDTR(i)
time.sleep(.5)
s.close()