Connect to the Myo armband using Web Bluetooth.
- Turn on your bluetooth.
- Visit this page
- 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.
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);
});
}
}
- Battery Level:
state.batteryLevel;
- Arm type:
//returns 'right' or 'left';
state.armType;
- Arm synced:
state.armSynced;
- Myo direction:
// returns 'wrist' or 'elbow';
state.myoDirection;
- Myo locked:
state.myoLocked;
- Orientation data:
state.orientation.x;
state.orientation.y;
state.orientation.z;
- Gyroscope data:
state.gyroscope.x;
state.gyroscope.y;
state.gyroscope.z;
- Accelerometer data:
state.accelerometer.x;
state.accelerometer.y;
state.accelerometer.z;
- Pose data:
// returns 'fist', 'wave in', 'wave out', 'fingers spread' or 'double tap';
state.pose;
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
- Add images of poses for visual feedback.
- Make orientation data work with 3d model.