Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import serial
- import time
- s=serial.Serial('COM180',baudrate=115200,bytesize=8,stopbits=1,parity='N')
- # s.open()
- s.write(b'xxxxxA\r\n')
- print(s.read_until(size=8))
- time.sleep(2)
- s.write(b'xxxxxB\r\n')
- print(s.read_until(size=8))
- time.sleep(2)
- s.write(b'xxxxxx\r\n')
- print(s.read_until(size=8))
- s.close()
Add Comment
Please, Sign In to add comment