@@ -29,30 +29,31 @@ This is easily achieved by downloading
29
29
Usage Example
30
30
=============
31
31
32
- ```python
33
- # This example shows using two TSL2491 light sensors attached to TCA9548A channels 0 and 1.
34
- # Use with other I2C sensors would be similar.
35
- import time
36
- import board
37
- import busio
38
- import adafruit_tsl2591
39
- import adafruit_tca9548a
40
-
41
- # Create I2C bus as normal
42
- i2c = busio.I2C(board.SCL, board.SDA)
43
-
44
- # Create the TCA9548A object and give it the I2C bus
45
- tca = adafruit_tca9548a.TCA9548A(i2c)
46
-
47
- # For each sensor, create it using the TCA9548A channel instead of the I2C object
48
- tsl1 = adafruit_tsl2591.TSL2591(tca[0])
49
- tsl2 = adafruit_tsl2591.TSL2591(tca[1])
50
-
51
- # Loop and profit!
52
- while True:
53
- print(tsl1.lux, tsl2.lux)
54
- time.sleep(0.1)
55
- ` ``
32
+ .. code-block :: python
33
+
34
+ # This example shows using two TSL2491 light sensors attached to TCA9548A channels 0 and 1.
35
+ # Use with other I2C sensors would be similar.
36
+ import time
37
+ import board
38
+ import busio
39
+ import adafruit_tsl2591
40
+ import adafruit_tca9548a
41
+
42
+ # Create I2C bus as normal
43
+ i2c = busio.I2C(board.SCL, board.SDA)
44
+
45
+ # Create the TCA9548A object and give it the I2C bus
46
+ tca = adafruit_tca9548a.TCA9548A(i2c)
47
+
48
+ # For each sensor, create it using the TCA9548A channel instead of the I2C object
49
+ tsl1 = adafruit_tsl2591.TSL2591(tca[0])
50
+ tsl2 = adafruit_tsl2591.TSL2591(tca[1])
51
+
52
+ # Loop and profit!
53
+ while True:
54
+ print(tsl1.lux, tsl2.lux)
55
+ time.sleep(0.1)
56
+
56
57
57
58
Contributing
58
59
============
0 commit comments