Skip to content

Commit 32a479b

Browse files
committed
Example code
1 parent 5bcb72c commit 32a479b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/usr/bin/python
22

3-
from Adafruit_TSL2561 import Adafruit_TSL2561
3+
from Adafruit_TSL2561 import AdafruitTSL2561
44

55
# Initialise the sensor
6-
LightSensor = Adafruit_TSL2561.AdafruitTSL2651()
6+
LightSensor = AdafruitTSL2561()
77

88
# Enable auto gain switching between 1x and 16x
99
# Default is False
1010
LightSensor.enable_auto_gain(True)
1111

1212
# Get the calculated lux value, this is a spot reading so if you're under light
13-
# lux = Adafruit_TSL2561.calculate_lux()
13+
lux = LightSensor.calculate_lux()
14+
15+
print ('Lux value is %d',lux)
1416

1517

0 commit comments

Comments
 (0)