Skip to content

Commit d530680

Browse files
author
caternuson
committed
md is not rst
1 parent f73676a commit d530680

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

README.rst

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,31 @@ This is easily achieved by downloading
2929
Usage Example
3030
=============
3131

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+
5657
5758
Contributing
5859
============

0 commit comments

Comments
 (0)