Connect to the Myo armband with Web Bluetooth
Connect to the Myo armband using Web Bluetooth.
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);
});
}
}
state.batteryLevel;
//returns 'right' or 'left';
state.armType;
state.armSynced;
// returns 'wrist' or 'elbow';
state.myoDirection;
state.myoLocked;
state.orientation.x;
state.orientation.y;
state.orientation.z;
state.gyroscope.x;
state.gyroscope.y;
state.gyroscope.z;
state.accelerometer.x;
state.accelerometer.y;
state.accelerometer.z;
// returns 'fist', 'wave in', 'wave out', 'fingers spread' or 'double tap';
state.pose;
Available so far:
Control Service
IMU Data Service
EMG Data Service
Battery Service
Classifier Service