Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
215ecfdf
Verified
Commit
215ecfdf
authored
Jul 23, 2019
by
Rahix
Browse files
docs: Document light_sensor module
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
01c6b903
Changes
2
Hide whitespace changes
Inline
Side-by-side
Documentation/index.rst
View file @
215ecfdf
...
...
@@ -24,6 +24,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/color
pycardium/display
pycardium/leds
pycardium/light-sensor
pycardium/vibra
.. toctree::
...
...
Documentation/pycardium/light-sensor.rst
0 → 100644
View file @
215ecfdf
``light_sensor`` - Ambient Brightness
=====================================
On the harmonic board, there is an IR-LED which can be used in reverse as a
crude brightness sensor. Values returned are in no particular unit but seem to
be fairly stable.
.. py:function:: light_sensor.start()
Turn on the ADC and start reading brightness values. This function must be
called before any measurements can be taken.
.. py:function:: light_sensor.get_reading()
Get an ambient brightness reading. The returned value is in no particular
unit, though it seems to be fairly stable. Common values:
- ~8: Very dark are
- ~17: Typical hackerspace brightness
- >200: Direct sunlight
:returns: A brightness reading in no particular unit
.. py:function:: light_sensor.stop()
Stop the ADC.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment