@@ -6,11 +6,17 @@ Introduction
6
6
:target: https://circuitpython.readthedocs.io/projects/irremote/en/latest/
7
7
:alt: Documentation Status
8
8
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
12
12
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 >`_
14
20
15
21
Dependencies
16
22
=============
@@ -25,7 +31,20 @@ This is easily achieved by downloading
25
31
Usage Example
26
32
=============
27
33
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)
29
48
30
49
Contributing
31
50
============
@@ -34,10 +53,49 @@ Contributions are welcome! Please read our `Code of Conduct
34
53
<https://github.com/adafruit/Adafruit_CircuitPython_irremote/blob/master/CODE_OF_CONDUCT.md> `_
35
54
before contributing to help this project stay welcoming.
36
55
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
39
95
40
- .. toctree ::
41
- :maxdepth: 2
96
+ cd docs
97
+ sphinx-build -E -W -b html . _build/html
42
98
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