https://github.com/charliegerard/myo-web-bluetooth.js
Connect to the Myo armband with Web Bluetooth
https://github.com/charliegerard/myo-web-bluetooth.js
myo myo-armband web-bluetooth
Last synced: 26 days ago
JSON representation
Connect to the Myo armband with Web Bluetooth
- Host: GitHub
- URL: https://github.com/charliegerard/myo-web-bluetooth.js
- Owner: charliegerard
- License: mit
- Created: 2017-03-12T21:32:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T20:43:01.000Z (about 8 years ago)
- Last Synced: 2025-04-14T02:34:35.897Z (26 days ago)
- Topics: myo, myo-armband, web-bluetooth
- Language: JavaScript
- Homepage: https://charliegerard.github.io/myo-web-bluetooth.js/
- Size: 7.66 MB
- Stars: 43
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Myo-web-bluetooth.js
Connect to the Myo armband using Web Bluetooth.
### Steps:
* Turn on your bluetooth.
* Visit [this page](https://charliegerard.github.io/myo-web-bluetooth.js/index.html)
* Click on the 'Connect' button.
* If no device is recognised, make sure the name of your Myo is the same one as me ("Myo").
* If the gestures are not recognised, make sure you execute the 'sync' gesture before connecting.### How to use:
```javascript
window.onload = function(){let button = document.getElementById("connect");
button.onclick = function(e){
var myoController = new MyoWebBluetooth("Myo");
myoController.connect();myoController.onStateChange(function(state){
let batteryLevel = state.batteryLevel + '%';
console.log(batteryLevel);
});
}
}
```### Data available:
* Battery Level:
```javascript
state.batteryLevel;
```* Arm type:
```javascript
//returns 'right' or 'left';
state.armType;
```* Arm synced:
```javascript
state.armSynced;
```* Myo direction:
```javascript
// returns 'wrist' or 'elbow';
state.myoDirection;
```* Myo locked:
```javascript
state.myoLocked;
```* Orientation data:
```javascript
state.orientation.x;
state.orientation.y;
state.orientation.z;
```* Gyroscope data:
```javascript
state.gyroscope.x;
state.gyroscope.y;
state.gyroscope.z;
```* Accelerometer data:
```javascript
state.accelerometer.x;
state.accelerometer.y;
state.accelerometer.z;
```* Pose data:
```javascript
// returns 'fist', 'wave in', 'wave out', 'fingers spread' or 'double tap';
state.pose;
```### Services and characteristics:
Available so far:
* Control Service
* Command characteristic* IMU Data Service
* IMU Data characteristic* EMG Data Service
* EMG Data characteristic* Battery Service
* Battery level characteristic* Classifier Service
* Classifier event characteristic### To do:
* Add images of poses for visual feedback.
* Make orientation data work with 3d model.