def pi_revision(self): """Get the version number of the Raspberry Pi board. Args: None Returns: An int containing the Pi board revision (1 or 2). If error, returns 0. """ return i2c.revision()
def pi_i2c_bus_number(self): """Get the I2C bus number /dev/i2c. Args: None Returns: An int containing i2c bus number """ if i2c.revision() > 1: return 1 else: return 0