Skip to content

Commit 533ccd8

Browse files
authored
Updated README.rst
code->code-block
1 parent 860b035 commit 533ccd8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,31 @@ for wiring and installation instructions.
3131

3232
First, import the library:
3333

34-
.. code:: python
34+
.. code-block:: python
35+
3536
import busio
3637
import adafruit_sgp30
3738
3839
Next, initialize the I2C bus object:
3940

40-
.. code:: python
41+
.. code-block:: python
42+
4143
from board import *
4244
i2c_bus = busio.I2C(board.SCL, board.SDA, frequency=100000)
4345
4446
Since we have the I2C bus object, we can now use it to instantiate the SGP30 object:
4547

46-
.. code:: python
48+
.. code-block:: python
49+
4750
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c_bus)
4851
4952
Reading from the Sensor
5053
--------------
5154

5255
To read from the sensor:
5356

54-
.. code:: python
57+
.. code-block:: python
58+
5559
co2eq, tvoc = sgp30.iaq_measure()
5660
print("CO2eq = %d ppm \t TVOC = %d ppb" % (co2eq, tvoc))
5761

0 commit comments

Comments
 (0)