-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor adaptations required by latest Adafruit pyton libraries
- Loading branch information
Showing
3 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,16 @@ | |
|
||
from __future__ import absolute_import | ||
import time | ||
from Adafruit_I2C import Adafruit_I2C | ||
from Adafruit_GPIO import I2C | ||
from .constants import * # pylint: disable=unused-wildcard-import | ||
|
||
__author__ = 'Georges Toth <[email protected]>' | ||
__credits__ = ['K.Townsend (Adafruit Industries)'] | ||
__license__ = 'BSD' | ||
__version__ = 'v2.0' | ||
__version__ = 'v2.1' | ||
|
||
'''HISTORY | ||
v2.1 - Minor adaptations required by latest Adafruit pyton libraries | ||
v2.0 - Rewrote driver for Adafruit_Sensor and Auto-Gain support, and | ||
added lux clipping check (returns 0 lux on sensor saturation) | ||
v1.0 - First release (previously TSL2561) | ||
|
@@ -31,15 +32,15 @@ | |
|
||
class TSL2561(object): | ||
'''Driver for the TSL2561 digital luminosity (light) sensors.''' | ||
def __init__(self, address=None, | ||
def __init__(self, address=None, busnum=None, | ||
integration_time=TSL2561_DELAY_INTTIME_402MS, | ||
gain=TSL2561_GAIN_1X, autogain=False, debug=False): | ||
if address is not None: | ||
self.address = address | ||
else: | ||
self.address = TSL2561_ADDR_FLOAT | ||
|
||
self.i2c = Adafruit_I2C(self.address) | ||
self.i2c = I2C.get_i2c_device(self.address, busnum=busnum) | ||
|
||
self.debug = debug | ||
self.integration_time = integration_time | ||
|