Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import time
- import serial
- g = str('gameboy')
- x = str('test')
- ser = serial.Serial(
- port='/dev/serial0',
- baudrate = 9600,
- parity=serial.PARITY_NONE,
- stopbits=serial.STOPBITS_ONE,
- bytesize=serial.EIGHTBITS,
- timeout=1
- )
- counter=0
- while 1:
- x=ser.readline()
- print x
- print str(g)
- if str(g) == str(x)
- print 'gameboy read'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement