|
1 |
| -# myo.js |
2 |
| -[](https://nodei.co/npm/myo/) |
3 |
| - |
4 |
| -Myo javascript bindings. |
5 |
| - |
6 |
| -Myo.js allows you to interact with Thalmic Labs's [Myo Gesture Control Armband](http://myo.com) using websockets. Listen for IMU, EMG, and gesture events, as well as controlling vibration and locking. |
7 |
| - |
8 |
| -## installation |
9 |
| -On the browser, just include the `myo.js` file in your project. `Myo` will be global. |
10 |
| - |
11 |
| -On node.js |
12 |
| - |
13 |
| - npm install myo |
14 |
| - |
15 |
| - |
16 |
| -## getting started |
17 |
| -You'll need a [Myo](http://myo.com) and [Myo Connect](https://developer.thalmic.com/downloads) |
18 |
| - |
19 |
| - var Myo = require('myo'); |
20 |
| - |
21 |
| - //Start talking with Myo Connect |
22 |
| - Myo.connect('com.stolksdorf.myAwesomeApp'); |
23 |
| - |
24 |
| - Myo.on('fist', function(){ |
25 |
| - console.log('Hello Myo!'); |
26 |
| - this.vibrate(); |
27 |
| - }); |
28 |
| - |
29 |
| - |
30 |
| - |
31 |
| - |
32 |
| -## myo lifecycle |
33 |
| -A myo can be **paired**, **connected**, and/or **synced**. |
34 |
| - |
35 |
| -A myo is **paired** if it's ever been connected to your computer. You can see a list of paired myos in Myo Connect's armband manager. When `Myo.connect()` is called, Myo.js will create a myo instance for every paired Myo on your computer and store them in `Myo.myos` array. |
36 |
| - |
37 |
| -A myo is **connected** if it's turned on and connected to your computer over bluetooth. It can send over IMU events at this point, vibrate, and EMG (if `myo.streamEMG(true)` is called) but not poses since it's not synced with the user. |
38 |
| - |
39 |
| -A myo is **synced** when the user puts it on and does the sync gesture. At this point it will start sending over pose and lock/unlock events. |
40 |
| - |
41 |
| - |
42 |
| - |
43 |
| - |
44 |
| -## branding and assets |
45 |
| -You can use assets provided in our [branding](https://developer.thalmic.com/branding/) and [UX](https://developer.thalmic.com/ux/) guidelines. |
46 |
| - |
47 |
| -## documentation |
48 |
| -You can read the full documention in [docs.md](docs.md) |
49 |
| - |
50 |
| -## changelog |
51 |
| -Releases are documented in [changelog.md](changelog.md) |
52 |
| - |
53 |
| -## license |
54 |
| -The Myo.js project is licensed using the modified BSD license. For more details, please see [LICENSE.txt](LICENSE.txt). |
55 |
| - |
56 |
| -### thanks |
57 |
| -Thanks to [stolksdorf](https://github.com/stolksdorf) for creating Myo.js |
| 1 | +# myo.js |
| 2 | +[](https://nodei.co/npm/myo/) |
| 3 | + |
| 4 | +Myo javascript bindings. |
| 5 | + |
| 6 | +Myo.js allows you to interact with Thalmic Labs's [Myo Gesture Control Armband](http://myo.com) using websockets. Listen for IMU, EMG, and gesture events, as well as controlling vibration and locking. |
| 7 | + |
| 8 | +## installation |
| 9 | +On the browser, just include the `myo.js` file in your project. `Myo` will be global. |
| 10 | + |
| 11 | +On node.js |
| 12 | + |
| 13 | + npm install myo ws |
| 14 | + |
| 15 | + |
| 16 | +## getting started |
| 17 | +You'll need a [Myo](http://myo.com) and [Myo Connect](https://developer.thalmic.com/downloads) |
| 18 | + |
| 19 | +##### Client-side |
| 20 | + |
| 21 | +```javascript |
| 22 | +Myo.connect('com.stolksdorf.myAwesomeApp'); |
| 23 | + |
| 24 | +Myo.on('fist', function(){ |
| 25 | + console.log('Hello Myo!'); |
| 26 | + this.vibrate(); |
| 27 | +}); |
| 28 | +``` |
| 29 | + |
| 30 | +##### Node |
| 31 | + |
| 32 | +```javascript |
| 33 | +var Myo = require('myo'); |
| 34 | + |
| 35 | +Myo.connect('com.stolksdorf.myAwesomeApp', require('ws')); |
| 36 | + |
| 37 | +Myo.on('fist', function(){ |
| 38 | + console.log('Hello Myo!'); |
| 39 | + this.vibrate(); |
| 40 | +}); |
| 41 | +``` |
| 42 | + |
| 43 | + |
| 44 | +## myo lifecycle |
| 45 | +A myo can be **paired**, **connected**, and/or **synced**. |
| 46 | + |
| 47 | +A myo is **paired** if it's ever been connected to your computer. You can see a list of paired myos in Myo Connect's armband manager. When `Myo.connect()` is called, Myo.js will create a myo instance for every paired Myo on your computer and store them in `Myo.myos` array. |
| 48 | + |
| 49 | +A myo is **connected** if it's turned on and connected to your computer over bluetooth. It can send over IMU events at this point, vibrate, and EMG (if `myo.streamEMG(true)` is called) but not poses since it's not synced with the user. |
| 50 | + |
| 51 | +A myo is **synced** when the user puts it on and does the sync gesture. At this point it will start sending over pose and lock/unlock events. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +## branding and assets |
| 57 | +You can use assets provided in our [branding](https://developer.thalmic.com/branding/) and [UX](https://developer.thalmic.com/ux/) guidelines. |
| 58 | + |
| 59 | +## documentation |
| 60 | +You can read the full documention in [docs.md](docs.md) |
| 61 | + |
| 62 | +## changelog |
| 63 | +Releases are documented in [changelog.md](changelog.md) |
| 64 | + |
| 65 | +## license |
| 66 | +The Myo.js project is licensed using the modified BSD license. For more details, please see [LICENSE.txt](LICENSE.txt). |
| 67 | + |
| 68 | +### thanks |
| 69 | +Thanks to [stolksdorf](https://github.com/stolksdorf) for creating Myo.js |
0 commit comments