-
Notifications
You must be signed in to change notification settings - Fork 8
Improve Ref Docs #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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8f293ec
renamed example; 1 learn guide will need updates
sommersoft c30a2de
setup docs folder
sommersoft 441fe46
updated .travis & .readthedocs yml
sommersoft a505ab3
updated README
sommersoft e142d70
updated info docstring; removed 'get/set' in docstrings
sommersoft a670761
sphinx fix
sommersoft 2bf5188
sphinx fix; how did i miss that
sommersoft ff79ea0
updated docstrings; removed 'returns'
sommersoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,13 +20,27 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
""" | ||
`Adafruit_VCNL4010` | ||
`adafruit_vcnl4010` | ||
==================================================== | ||
|
||
CircuitPython module for the VCNL4010 proximity and light sensor. See | ||
examples/simpletest.py for an example of the usage. | ||
examples/vcnl4010_simpletest.py for an example of the usage. | ||
|
||
* Author(s): Tony DiCola | ||
|
||
Implementation Notes | ||
-------------------- | ||
|
||
**Hardware:** | ||
|
||
* Adafruit `VCNL4010 Proximity/Light sensor breakout | ||
<https://www.adafruit.com/product/466>`_ (Product ID: 466) | ||
|
||
**Software and Dependencies:** | ||
|
||
* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: | ||
https://github.com/adafruit/circuitpython/releases | ||
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice | ||
""" | ||
from micropython import const | ||
|
||
|
@@ -114,7 +128,7 @@ def _write_u8(self, address, val): | |
|
||
@property | ||
def led_current(self): | ||
"""Get and set the current of the LED. The value is in units of 10mA | ||
"""The current of the LED. The value is in units of 10mA | ||
and can only be set to 0 (0mA/off) to 20 (200mA). See the datasheet | ||
for how LED current impacts proximity measurements. The default is | ||
200mA. | ||
|
@@ -128,7 +142,7 @@ def led_current(self, val): | |
|
||
@property | ||
def led_current_mA(self): | ||
"""Get and set the current of the LED in milli-amps. The value here is | ||
"""The current of the LED in milli-amps. The value here is | ||
specified in a milliamps from 0-200. Note that this value will be | ||
quantized down to a smaller less-accurate value as the chip only | ||
supports current changes in 10mA increments, i.e. a value of 123 mA will | ||
|
@@ -144,12 +158,14 @@ def led_current_mA(self, val): | |
|
||
@property | ||
def frequency(self): | ||
"""Get and set the frequency of proximity measurements. Must be a value | ||
of: | ||
- FREQUENCY_3M125: 3.125 Mhz | ||
- FREQUENCY_1M5625: 1.5625 Mhz | ||
- FREQUENCY_781K25: 781.25 Khz | ||
- FREQUENCY_390K625: 390.625 Khz (default) | ||
""" | ||
The frequency of proximity measurements. Must be a value of: | ||
|
||
- FREQUENCY_3M125: 3.125 Mhz | ||
- FREQUENCY_1M5625: 1.5625 Mhz | ||
- FREQUENCY_781K25: 781.25 Khz | ||
- FREQUENCY_390K625: 390.625 Khz (default) | ||
|
||
See the datasheet for how frequency changes the proximity detection | ||
accuracy. | ||
""" | ||
|
@@ -168,7 +184,7 @@ def frequency(self, val): | |
# pylint: disable=inconsistent-return-statements | ||
@property | ||
def proximity(self): | ||
"""Get the detected proximity of an object in front of the sensor. This | ||
"""Returns the detected proximity of an object in front of the sensor. This | ||
is a unit-less unsigned 16-bit value (0-65535) INVERSELY proportional | ||
to the distance of an object in front of the sensor (up to a max of | ||
~200mm). For example a value of 10 is an object farther away than a | ||
|
@@ -189,7 +205,7 @@ def proximity(self): | |
|
||
@property | ||
def ambient(self): | ||
"""Get the detected ambient light in front of the sensor. This is | ||
"""Returns the detected ambient light in front of the sensor. This is | ||
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. |
||
a unit-less unsigned 16-bit value (0-65535) with higher values for | ||
more detected light. See the ambient_lux property for a value in lux. | ||
""" | ||
|
@@ -208,7 +224,7 @@ def ambient(self): | |
|
||
@property | ||
def ambient_lux(self): | ||
"""Get the detected ambient light in front of the sensor as a value in | ||
"""Returns the detected ambient light in front of the sensor as a value in | ||
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. |
||
lux. | ||
""" | ||
return self.ambient * _VCNL4010_AMBIENT_LUX_SCALE |
Binary file not shown.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Simple test | ||
------------ | ||
|
||
Ensure your device works with this simple test. | ||
|
||
.. literalinclude:: ../examples/vcnl4010_simpletest.py | ||
:caption: examples/vcnl4010_simpletest.py | ||
:linenos: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.. include:: ../README.rst | ||
|
||
Table of Contents | ||
================= | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
:hidden: | ||
|
||
self | ||
|
||
.. toctree:: | ||
:caption: Examples | ||
|
||
examples | ||
|
||
.. toctree:: | ||
:caption: API Reference | ||
:maxdepth: 3 | ||
|
||
api | ||
|
||
.. toctree:: | ||
:caption: Tutorials | ||
|
||
.. toctree:: | ||
:caption: Related Products | ||
|
||
VCNL4010 Proximity/Light sensor <https://www.adafruit.com/product/466> | ||
|
||
|
||
.. toctree:: | ||
:caption: Other Links | ||
|
||
Download <https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010/releases/latest> | ||
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io> | ||
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60> | ||
Discord Chat <https://adafru.it/discord> | ||
Adafruit Learning System <https://learn.adafruit.com> | ||
Adafruit Blog <https://blog.adafruit.com> | ||
Adafruit Store <https://www.adafruit.com> | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"The detected ..." Remove "Returns".