Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jul 19, 2022. It is now read-only.
/myolibPublic archive

Android Myo library with full data access and support for multiple Myos.

License

NotificationsYou must be signed in to change notification settings

d4rken/myolib

Repository files navigation

Coverage StatusBuild Status

This is an Android library to communicate with Myo devices.

It was created for a research project at themHealth - Uniklinik RWTH Aachen deparment. The projected required receiving sensor data (Gyro, Accl., EMG) from multiple Myo devices simultaneously, which was not possible at that time (August 2015) through the official Android SDK for Myo from Thalmic Labs.

Contributions are welcome. If you submit pull-requests please adhere to the projects current coding style.If you are using this library, i would love mention your project here, feel free to contact me.

Setup

Add it in your root build.gradle at the end of repositories:

allprojects {    repositories {...        maven { url'https://jitpack.io' }    }}

Include this in your apps build.gradle file:

dependencies {        implementation'com.github.d4rken:myolib:0.0.5'}

Examples

Utilizing callbacks

MyoConnectorconnector =newMyoConnector(getContext());connector.scan(5000,newMyoConnector.ScannerCallback() {@OverridepublicvoidonScanFinished(List<Myo>myos) {Myomyo =myos.get(0);myo.connect();myo.writeUnlock(MyoCmds.UnlockType.HOLD,newMyo.MyoCommandCallback() {@OverridepublicvoidonCommandDone(Myomyo,MyoMsgmsg) {myo.writeVibrate(MyoCmds.VibrateType.LONG,null);            }        });    }});

Receiving sensor data

/** * ... */Myomyo =myos.get(0);myo.connect();EmgProcessoremgProcessor =newEmgProcessor();myo.addProcessor(emgProcessor);emgProcessor.addListener(newEmgProcessor.EmgDataListener() {@OverridepublicvoidonNewEmgData(EmgDataemgData) {Log.i("EMG-Data",Arrays.toString(emgData.getData()));    }});

Advanced use

BaseMyobaseMyo =newBaseMyo(getContext(),bluetoothDevice);baseMyo.connect();ReadMsgreadMsg =newReadMsg(Battery.BATTERYLEVEL,newMyoMsg.Callback() {@OverridepublicvoidonResult(MyoMsgmsg) {byte[]result = ((ReadMsg)msg).getValue();    }});baseMyo.submit(readMsg);

Advanced advanced use

BaseMyobaseMyo =newBaseMyo(getContext(),bluetoothDevice);baseMyo.connect();WriteMsgwriteMsg =newWriteMsg(UUID.fromString("00001800-0000-1000-8000-00805f9b34fb"),UUID.fromString("00002A00-0000-1000-8000-00805f9b34fb"),null,newbyte[]{/*....*/},newMyoMsg.Callback() {@OverridepublicvoidonResult(MyoMsgmsg) {if(msg.getGattStatus() ==BluetoothGatt.GATT_SUCCESS)Log.i("MYOAPP","Data written!");            }        });baseMyo.submit(writeMsg);

Example app

License

This library is licensed under Apache 2.0, seeLICENSE

If you use "Android Myo library by darken" for your publication, please cite the following publication:

  • Kutafina E, Laukamp D, Jonas SM. Wearable Sensors in Medical Education: Supporting Hand Hygiene Training with a Forearm EMG. Stud Health Technol Inform. 2015;211:286-91.

About

Android Myo library with full data access and support for multiple Myos.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp