Advertisement
Push28

python nightmare

Aug 18th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import time
  3. import serial
  4. g = str('gameboy')
  5. x = str('test')
  6. ser = serial.Serial(
  7.  
  8.                port='/dev/serial0',
  9.                baudrate = 9600,
  10.                parity=serial.PARITY_NONE,
  11.                stopbits=serial.STOPBITS_ONE,
  12.                bytesize=serial.EIGHTBITS,
  13.                timeout=1
  14.            )
  15. counter=0
  16. while 1:
  17.                x=ser.readline()
  18.                print x
  19.                print str(g)
  20. if str(g) ==  str(x)
  21.                print 'gameboy read'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement