Exemplo n.º 1
0
    def __init__(self, sensor_name, bus=None):
        

        I2CSensorBase.__init__(
            self, 
            sensor_name=sensor_name, 
            bus=bus, 
            address=0x77)

        self._ds_defaults = False

        self._ac0 = None
        self._ac1 = None
        self._ac2 = None
        self._ac3 = None
        self._ac4 = None
        self._ac5 = None
        self._ac6 = None
        self._b1 = None
        self._b2 = None
        self._mb = None
        self._mc = None
        self._md = None
        self._os_mode = OS_MODE_SINGLE

        self._readCalData()
Exemplo n.º 2
0
    def __init__(self, sensor_name, bus=None, addr=TSL2561_I2CADDR_GND):
        '''Initializes the sensor with some default values.

        bus: The SMBus descriptor on which this sensor is attached.
        addr: The I2C bus address
            (default is 0x39).
        '''

        I2CSensorBase.__init__(
            self, 
            sensor_name=sensor_name,
            bus=bus,
            address=addr)

        # TODO: Only power on when necessary
        self._setPowerState(TSL2561_POWER_ON)