Ejemplo n.º 1
0
    def write(self, byte):
        try:
            I2C.start_tx(self.__addr)
            I2C.write(byte)

        finally:
            I2C.end_tx()
Ejemplo n.º 2
0
    def __write(self, config):
        try:
            I2C.start_tx(self.addr)
            I2C.write(config)

        finally:
            I2C.end_tx()
Ejemplo n.º 3
0
    def __write_config(self, config):
        try:
            I2C.start_tx(self.__addr)
            I2C.write(ADS1115.__REG_CONFIG, config >> 8, config & 0xff)

        finally:
            I2C.end_tx()
    def convert(cls):
        try:
            I2C.start_tx(MPL115A2Reg.__I2C_ADDR)
            I2C.write(cls.__CMD_START_CONV, 0x00)

        finally:
            I2C.end_tx()
Ejemplo n.º 5
0
 def __write_reg(cls, addr, value):
     try:
         I2C.start_tx(cls.__ADDR)
         I2C.write(addr, value)
     finally:
         I2C.end_tx()
Ejemplo n.º 6
0
 def __write_config(cls, config):
     try:
         I2C.start_tx(cls.__ADDR)
         I2C.write(cls.__REG_CONFIG, config >> 8, config & 0xff)
     finally:
         I2C.end_tx()