Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- #!/usr/bin/ python
- import time
- import serial
- ser = serial.Serial(
- port='/dev/ttyUSB0',
- baudrate = 9600,
- parity=serial.PARITY_NONE,
- stopbits=serial.STOPBITS_ONE,
- bytesize=serial.EIGHTBITS,
- timeout=None
- )
- while 1:
- x=ser.readline().decode('utf-8')
- with open('outputbarcode.txt', 'a+') as myfile:
- myfile.write(x)
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement