From dcb4c89a9bd362ca8158f8e2c3ff5ed529b6ea73 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Mon, 4 Jan 2016 03:58:18 +0100 Subject: [PATCH] fixed doc examples, added installation section and updated README requirements --- README.md | 4 ++++ docs/index.rst | 20 ++++++++++++++++++-- docs/myo.rst | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79f8478..13451cc 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/index.rst b/docs/index.rst index bddc041..85ad86b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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): @@ -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) @@ -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) @@ -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 `_ +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 ================== diff --git a/docs/myo.rst b/docs/myo.rst index a45b55a..600a1a7 100644 --- a/docs/myo.rst +++ b/docs/myo.rst @@ -1,4 +1,6 @@ +.. autofunction:: myo.init + .. autoclass:: myo.Hub :members: :undoc-members: