Skip to content

Commit

Permalink
fixed doc examples, added installation section and updated README req…
Browse files Browse the repository at this point in the history
…uirements
  • Loading branch information
NiklasRosenstein committed Jan 4, 2016
1 parent 7bae9d9 commit dcb4c89
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ finally:
hub.shutdown() # !! crucial
```

__Requirements__

- [six](https://pypi.python.org/pypi/six) [required]

__Projects that use myo-python__

- [Myo Matlab](https://github.com/yijuilee/myomatlab)
Expand Down
20 changes: 18 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ that will be invoked on various events and when data becomes available.
.. code-block:: python
from time import sleep
from myo import Hub, DeviceListener
from myo import init, Hub, DeviceListener
class Listener(DeviceListener):
Expand All @@ -45,6 +45,7 @@ that will be invoked on various events and when data becomes available.
def on_orientation_data(self, myo, timestamp, quat):
print("Orientation:", quat.x, quat.y, quat.z, quat.w)
init()
listener = DeviceListener()
hub = Hub()
hub.run(1000, listener)
Expand All @@ -65,8 +66,9 @@ contains the most recent data. These proxy objects are thread-safe.

.. code-block:: python
from myo import Hub, Feed
from myo import init, Hub, Feed
init()
feed = Feed()
hub = Hub()
hub.run(1000, feed)
Expand All @@ -82,6 +84,20 @@ contains the most recent data. These proxy objects are thread-safe.
finally:
hub.shutdown() # !! crucial
Installation
------------

Since the Thalmic Myo SDK is only available for Windows and Mac, myo-python
can only be used on these two platforms.

1. Install ``myo-python`` via Pip: ``pip install myo-python``
2. Download the `Myo SDK <https://developer.thalmic.com/downloads>`_
3. Make sure the library can find the Myo shared library by setting
``PATH`` on Windows or ``DYLD_LIBRARY_PATH`` on Mac

.. note:: You can also pass the path to the shared library to :func:`myo.init`.


Indices and tables
==================

Expand Down
2 changes: 2 additions & 0 deletions docs/myo.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

.. autofunction:: myo.init

.. autoclass:: myo.Hub
:members:
:undoc-members:
Expand Down

0 comments on commit dcb4c89

Please sign in to comment.