Myo Armband

From IoT
Jump to: navigation, search

Go Up to ThingConnect Devices


Myo Armband is a Bluetooth gesture control armband that reads the muscle activity in your forearm, and gives you touch-free control of technology with hand gestures and motion.

Use the TMyo component to communicate with the Myo Armband.

Demo Project Samples

You can find the sample projects for the Myo Armband in the following IoT demo directories after installing the component:

  • Start | Programs | Embarcadero RAD Studio Berlin | Samples and then navigate to:
    • Delphi: Internet of Things\Object Pascal\Thing Connect\MyoArmband
    • C++: Internet of Things\CPP\Thing Connect\MyoArmband

Supported Services

The Myo Armband supports the following BluetoothLE services and characteristics:

Service Characteristic Property Event Read Subscribe Write
Battery Service Battery Level BatteryLevel OnBatteryLevelUpdate
YesSubscriptionFeature.png
YesSubscriptionFeature.png
Device Information Manufacturer Name String ManufacturerName OnManufacturerNameUpdate
YesSubscriptionFeature.png

Myo Armband component supports the following custom services:

Service Property Event Reade Subscribe Write Description
Myo Classifier Service OnClassifierEventDataUpdate
YesSubscriptionFeature.png
IClassifier event data with TMyoClassifierEvent type.
Myo EMG Data Service OnEMGData0Update
YesSubscriptionFeature.png
EMG Data0 with TMyoEMGData type.
OnEMGData1Update
YesSubscriptionFeature.png
EMG Data1 with TMyoEMGData type.
OnEMGData2Update
YesSubscriptionFeature.png
EMG Data2 with TMyoEMGData type.
OnEMGData3Update
YesSubscriptionFeature.png
EMG Data3 with TMyoEMGData type.
Myo IMU Data Service OnIMUDataUpdate
YesSubscriptionFeature.png
IMU data with TIMUDataService type.
Myo Info Service Command
YesSubscriptionFeature.png
Writes a command with TMyoCommand type.
FirmwareVersion OnFirmwareVersionUpdate
YesSubscriptionFeature.png
Reads the firmware version with TMyoFirmwareVersion type.
Info OnInfoUpdate
YesSubscriptionFeature.png
Reads the Myo info with TMyoInfoService type.

Custom Data Types

The Myo Armband defines its custom data types in the following unit:

  • Iot.Device.MyoTypes

Myo Armband EMG Data

The TMyoEMGData record contains the byte array for EMG Data characteristic.

  • Create: Initializes an instance of TMyoEMGData with an array of bytes received from the device.
  • Value: Raw array of bytes received from the device.

Myo Armband HW Pose

TMyoHWPose enumerates the supported poses Rest, Fist, WaveIn, WaveOut, FingersSpread, DoubleTap, and Unknown = $FFFF.

Myo Armband Active Classifier Type

TMyoActiveClassifierType enumerates the possible Myo classifier model types Builtin and Custom.

Myo Armband Stream Indicating Source

TMyoStreamIndicatingSource enumerates the possible Myo sources of data stream BLE and OtherSource.

Myo Armband SKU Value

TMyoSKUValue enumerates the known Myo SKUs BlackMyo, WhiteMyo, and Unknown. Unknown is de default value for old firmwares.

Myo Armband Info Service

The TMyoInfoService record contains various parameters that may affect the behaviour of this Myo armband when a connection is established.

  • Create: Initializes an instance of TMyoInfoService with an array of bytes received from the device.
  • Value: Raw array of bytes received from the device.
  • SerialNumber: Returns a UInt64 with the unique serial number of the Myo.
  • HWPose: Returns the pose that should be interpreted as the unlock pose.
  • ActiveClassifierType: Returns a TMyoActiveClassifierType indicating whether Myo is currently using a built-in or a custom classifier.
  • ActiveClassifierIndex: Returns a UInt8 indicating the index of the classifier that is currently active.
  • HasCustomClassifier: Returns whether Myo contains a valid custom classifier. 1 if it does, 0 otherwise.
  • StreamIndicatingSource: Returns a TMyoStreamIndicatingSource indicating if the Myo uses BLE to stream data for reliable capture.
  • SKUValue: Returns the SKU value of the device.

Myo Armband Firmware Version

The TMyoFirmwareVersion record contains the version information for the Myo firmware.

  • Create: Initializes an instance of TMyoFirmwareVersion with an array of bytes received from the device.
  • Value: Raw array of bytes received from the device.
  • MajorVersion: Returns a UInt16 with the major version of the firmware.
  • MinorVersion: Returns a UInt16 with the minor version. The minor version is incremented for changes in the interface.
  • PatchVersion: Returns a UInt16 with the patch version. The patch version is incremented for firmware changes that do not introduce changes in the interface.
  • HardwareRevision: Returns a UInt8 with the Myo hardware revision.

Myo Armband Command Type

TMyoCommandType enumerates the possible command types:

  • SetMode = $01: Set EMG and IMU modes.
  • Vibration = $03: Set vibration.
  • DeepSleep = $04: Put Myo in deep sleep.
  • Vibrate2 = $07: Extended vibrate.
  • SetSleepMode = $09: Set sleep mode.
  • Unlock = $0A: Unlock Myo.
  • UserAction = $0B: Notify user that an action has been recognised or confirmed.

Myo Armband EMG Mode

TMyoEMGMode enumerates the possible EMG Modes.

  • None = $00: Do not send EMG data.
  • SendEMG = $02: Send filtered EMG data.
  • SendEMGRaw = $03: Send raw (unfiltered) EMG data.

Myo Armband IMU Mode

TMyoIMUMode enumerates the possible IMU modes.

  • None: Do not send IMU data or events.
  • SendData: Send IMU data streams accelerometer, gyroscope, and orientation.
  • SendEvents: Send motion events detected by the IMU.
  • SendAll: Send both IMU data streams and motion events.
  • SendRaw: Send raw IMU data streams.

Myo Armband Classifier Mode

TMyoClassifierMode enumerates the possible classifier modes.

  • Disabled: Disable and reset the internal state of the onboard classifier.
  • Enabled: Send classifier events (poses and arm events).

Myo Armband Command

The TMyoCommand record contains the byte array for Myo commands.

  • Create: The constructor has five overloaded methods.
    • First overloaded method: Initializes an instance of TDelayOnOff with an array of bytes received from the device.
      • Parameters: AValue with TBytes type.
    • Second overloaded method: Constructor for Myo command using one parameter.
    • Third overloaded method: Constructor for Myo set mode command.
    • Fourth overloaded method: Constructor for Myo commands using two parameter.
      • Parameters: ACommand with the command type, and AData with integer type.
    • Fifth overloaded method: Constructor for Myo extended vibrate command.

ADuration with the duration as a UInt16, and AStrength with the strength as a UInt8.

  • Value: Raw array of bytes received from the device.
  • CommandType: Returns the command type.
  • PayloadSize: Returns the command payload size (UInt8) that excludes the command type and size byte itself.
  • EMGMode: Returns the EMG mode.
  • IMUMode: Returns the IMU mode.
  • ClassifierMode: Returns the classifier mode.
  • Duration: Returns the array of UInt16, containing the vibration durations.
  • Strength: Returns the array of UInt8, containing the vibration strengths.

Myo Armband IMU Data Service

The TIMUDataService record contains the byte array for orientation data.

  • Create: Initializes an instance of TIMUDataService with an array of bytes received from the device.
  • Value: Raw array of bytes received from the device.
  • WOrientation: Returns an Int16 value indicating W Orientation.
  • XOrientation: Returns an Int16 value indicating X Orientation.
  • YOrientation: Returns an Int16 value indicating Y Orientation.
  • ZOrientation: Returns an Int16 value indicating Z Orientation.
  • Accelerometer: Returns an Int64 value indicating Accelerometer data. In units of g. Range of +/-16.Values are multiplied by MyoHwAccelerometerScale (2048).
  • Gyroscope: Returns an Int64 value indicating Gyroscope data. In units of deg/s. Range of +/-2000.Values are multiplied by MyoHwGyroscopeScale (16).

Myo Armband Classifier Event Type

TMyoClassifierEventType enumerates the possible classifier event types ArmSynced = 1, ArmUnsynced, Pose, Unlocked, Locked, and SyncFailed.

Myo Armband Arm

TMyoArm enumerates the possible values to identify the arm Right = 1, Left, and Unknown = $FF.

Myo Armband X Direction

TMyoXDirection enumerates the possible directions for the x axis of Myo relative to the arm of the user TowardsWrist = 1, TowardsElbow, and Unknown = $FF.

Myo Armband Sync Result

TMyoSyncResult enumerates the possible outcomes when the user attempts a sync gesture Unknown and SyncFailedTooHard.

Myo Armband Classifier Event

The TMyoClassifierEvent record contains the byte array for classifier event data.

  • Create: Initializes an instance of TMyoClassifierEvent with an array of bytes received from the device.
  • Value: Raw array of bytes received from the device.
  • EventType: Returns the classifier event type.
  • Arm: Returns the arm of the user.
  • XDirection: Returns the Myo X direction with the possible directions x axis of Myo relative to the arm of the user.
  • Pose: Returns the unlock pose.
  • SyncResult: Returns sync result indicating the possible outcome when user attempts a sync gesture.

Device Details

  • Device: Myo Armband
  • Model: MYO
  • Technology: Bluetooth LE

Known Issues

  • Myo Armband device cannot be paired to a Windows machine. If the target platform of your application is 32-bit Windows or 64-bit Windows, it cannot be paired to the Myo Armband.

Device Specific Information

MyoArmband requires enabling/disabling reading characteristics any time it is connected or re-connected due to its battery saving behavior. This device supports 3 main characteristics:

  1. IMUData for motion data
  2. ClassiffierEvent for pose data (hand and wrist gestures)
  3. EMGData: electromyography data.
    Note: the EMG data is rarely used. However, if you do, be sure to have the firmware updated. This characteristic is available since December 2014.

To enable/disable these characteristics, you must send a command. For example, to enable all of these characteristics:, do the following

Myo1.Command := TMyoCommand.Create(TMyoCommandType.SetMode, TMyoEMGMode.SendEMG, TMyoIMUMode.SendAll, TMyoClassifierMode.Enabled);

You must also be sure MyoArmband is unlocked. To permanently set it to unlocked (until a new lock command is received), use the following command:

Myo1.Command := TMyoCommand.Create(TMyoCommandType.Unlock, Integer(TMyoUnlockType.Hold));

See Also