This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smbus | |
| from time import * | |
| class i2c_device: | |
| def __init__(self, addr, port=1): | |
| self.addr = addr | |
| self.bus = smbus.SMBus(port) | |
| # Write a single command | |
| def write_cmd(self, cmd): |