Skip to content

Commit 5df0d9d

Browse files
committed
update README
1 parent e31562e commit 5df0d9d

File tree

1 file changed

+68
-10
lines changed

1 file changed

+68
-10
lines changed

README.rst

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ Introduction
66
:target: https://circuitpython.readthedocs.io/projects/irremote/en/latest/
77
:alt: Documentation Status
88

9-
.. image :: https://badges.gitter.im/adafruit/circuitpython.svg
10-
:target: https://gitter.im/adafruit/circuitpython?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
11-
:alt: Gitter
9+
.. image :: https://img.shields.io/discord/327254708534116352.svg
10+
:target: https://discord.gg/nBQh6qu
11+
:alt: Discord
1212
13-
TODO
13+
CircuitPython driver for use with IR Receivers.
14+
15+
Examples of products to use this library with:
16+
17+
* `CircuitPlayground Express <https://www.adafruit.com/product/3333>`_
18+
19+
* `IR Receiver Sensor <https://www.adafruit.com/product/157>`_
1420

1521
Dependencies
1622
=============
@@ -25,7 +31,20 @@ This is easily achieved by downloading
2531
Usage Example
2632
=============
2733

28-
TODO
34+
.. code-block:: python
35+
36+
# CircuitPlayground Express Demo Code
37+
# Adjust the pulseio 'board.PIN' if using something else
38+
import pulseio
39+
import board
40+
import adafruit_irremote
41+
42+
with pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) as p:
43+
d = adafruit_irremote.GenericDecode()
44+
code = bytearray(4)
45+
while True:
46+
d.decode(p, code)
47+
print(code)
2948
3049
Contributing
3150
============
@@ -34,10 +53,49 @@ Contributions are welcome! Please read our `Code of Conduct
3453
<https://github.com/adafruit/Adafruit_CircuitPython_irremote/blob/master/CODE_OF_CONDUCT.md>`_
3554
before contributing to help this project stay welcoming.
3655

37-
API Reference
38-
=============
56+
Building locally
57+
================
58+
59+
To build this library locally you'll need to install the
60+
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
61+
62+
.. code-block:: shell
63+
64+
python3 -m venv .env
65+
source .env/bin/activate
66+
pip install circuitpython-build-tools
67+
68+
Once installed, make sure you are in the virtual environment:
69+
70+
.. code-block:: shell
71+
72+
source .env/bin/activate
73+
74+
Then run the build:
75+
76+
.. code-block:: shell
77+
78+
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-irremote --library_location .
79+
80+
Sphinx documentation
81+
-----------------------
82+
83+
Sphinx is used to build the documentation based on rST files and comments in the code. First,
84+
install dependencies (feel free to reuse the virtual environment from above):
85+
86+
.. code-block:: shell
87+
88+
python3 -m venv .env
89+
source .env/bin/activate
90+
pip install Sphinx sphinx-rtd-theme
91+
92+
Now, once you have the virtual environment activated:
93+
94+
.. code-block:: shell
3995
40-
.. toctree::
41-
:maxdepth: 2
96+
cd docs
97+
sphinx-build -E -W -b html . _build/html
4298
43-
api
99+
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
100+
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
101+
locally verify it will pass.

0 commit comments

Comments
 (0)