def set_gain(self, gain=1):
        """ Set the gain """
        if gain == 1:
            self.i2c.write8(0x81, 0x02)
        else:
            self.i2c.write8(0x81, 0x12)

        time.sleep(self.pause)
def set_gain ( self , gain = 1 ) : if gain == 1 : self . i2c . write8 ( 0x81 , 0x02 ) else : self . i2c . write8 ( 0x81 , 0x12 ) time . sleep ( self . pause )
Set the gain