-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved some logging details to module level in docs. Added missing Ambient light documentation.
- Loading branch information
Showing
4 changed files
with
84 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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,39 @@ | ||
.. _modules_accelerometer: | ||
|
||
Ambient light module | ||
==================== | ||
|
||
The PyMetaWear implementation of the ``libmetawear`` | ||
ambient light module. | ||
|
||
It is initialized at the creation of the :py:class:`~MetaWearClient` | ||
client and can then be accessed in the ``ambient_light`` | ||
attribute of the client. | ||
|
||
Data streaming example | ||
---------------------- | ||
|
||
If you need a real time stream of sensor data, use the :py:method:`notifications` method on the :py:mod:`ambient_light` module: | ||
|
||
.. code-block:: python | ||
from pymetawear.client import MetaWearClient | ||
c = MetaWearClient('DD:3A:7D:4D:56:F0') | ||
print("Write ambient light settings...") | ||
c.ambient_light.set_settings(gain=4, integration_time=200, measurement_rate=200) | ||
def ambient_light_callback(data): | ||
"""Handle a (epoch, data) ambient light data tuple.""" | ||
print("Epoch time: [{0}] Data: {1}".format(data[0], data[1])) | ||
# Enable notifications and register a callback for them. | ||
c.ambient_light.notifications(ambient_light_callback) | ||
API | ||
--- | ||
|
||
.. automodule:: pymetawear.modules.ambientlight | ||
:members: |
This file contains 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 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