-
Notifications
You must be signed in to change notification settings - Fork 42
Fix autodoc + Usage Notes #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,10 +23,38 @@ Please ensure all dependencies are available on the CircuitPython filesystem. | |
This is easily achieved by downloading | ||
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_. | ||
|
||
Usage Example | ||
Usage Notes | ||
============= | ||
|
||
TODO | ||
See `the guide <https://learn.adafruit.com/adafruit-sgp30-gas-tvoc-eco2-mox-sensor/circuitpython-wiring-test>`_ | ||
for wiring and installation instructions. | ||
|
||
First, import the library: | ||
|
||
.. code:: python | ||
import busio | ||
import adafruit_sgp30 | ||
|
||
Next, initialize the I2C bus object: | ||
|
||
.. code:: python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
from board import * | ||
i2c_bus = busio.I2C(board.SCL, board.SDA, frequency=100000) | ||
|
||
Since we have the I2C bus object, we can now use it to instantiate the SGP30 object: | ||
|
||
.. code:: python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c_bus) | ||
|
||
Reading from the Sensor | ||
-------------- | ||
|
||
To read from the sensor: | ||
|
||
.. code:: python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
co2eq, tvoc = sgp30.iaq_measure() | ||
print("CO2eq = %d ppm \t TVOC = %d ppb" % (co2eq, tvoc)) | ||
|
||
|
||
API Reference | ||
============= | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't rendering when I view it. If it's working for you, let me know. Otherwise please sort what the issue is - it may need to be
code-block
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. Code -> code-block and an extra space rendered correctly.