Skip to content

Commit 4559bb5

Browse files
committed
Added example and fixed class name
1 parent 51cdf34 commit 4559bb5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Adafruit_TSL2561/Adafruit_TSL2561.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import time
2929
from Adafruit_I2C import Adafruit_I2C
3030

31-
class Adafruit_TSL2651(Adafruit_I2C):
31+
class Adafruit_TSL2561(Adafruit_I2C):
3232
TSL2561_VISIBLE =2 # channel 0 - channel 1
3333
TSL2561_INFRARED =1 # channel 1
3434
TSL2561_FULLSPECTRUM =0 # channel 0
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+

0 commit comments

Comments
 (0)