Advertisement
silver2row

Heh? i2c?

Jan 8th, 2024
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. # from docs.beagleboard.org and the BeagleBone-Cookbook
  4.  
  5. import time
  6. import smbus
  7.  
  8. ms = 1000
  9. bus = smbus.SMBus(1)
  10. addr = 0x28
  11.  
  12. while True:
  13.     data = bus.read_byte_data(addr, 0)
  14.     print("Gas per ______ " + str(data))
  15.     time.sleep(ms/1000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement