File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 28
28
import time
29
29
from Adafruit_I2C import Adafruit_I2C
30
30
31
- class Adafruit_TSL2651 (Adafruit_I2C ):
31
+ class Adafruit_TSL2561 (Adafruit_I2C ):
32
32
TSL2561_VISIBLE = 2 # channel 0 - channel 1
33
33
TSL2561_INFRARED = 1 # channel 1
34
34
TSL2561_FULLSPECTRUM = 0 # channel 0
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+
3
+ from Adafruit_TSL2561 import Adafruit_TSL2561
4
+
5
+ # Initialise the sensor
6
+ LightSensor = Adafruit_TSL2561 .Adafruit_TSL2651 ()
7
+
8
+ # Enable auto gain switching between 1x and 16x
9
+ # Default is False
10
+ LightSensor .enableAutoGain (True )
11
+
12
+ # Get the calculated lux value, this is a spot reading so if you're under light
13
+ # lux = Adafruit_TSL2561.calculateLux()
14
+
15
+
You can’t perform that action at this time.
0 commit comments