Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smbus
- import time
- #bus = smbus.SMBus(0) # Rev 1 Pi uses 0
- bus = smbus.SMBus(1) # Rev 2 Pi uses 1
- DEVICE = 0x12
- char=''
- out=''
- print bus.write_byte(DEVICE,15)
- print 'start'
- while True:
- rd=bus.read_byte(DEVICE)
- if rd==0:
- print out
- out=''
- bus.write_byte(DEVICE,15)
- else:
- out = out+chr(rd)
- time.sleep(0.05)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement