Let’s get a little deeper into the Myo armband. Myo read electrical signs from your arm and it can detect up to 5 distinct poses: wave left, wave right, spread fingers, fist, and pinch. It also has a couple of motion sensors, so with all this information you can start to think into possibilities.
The armband collect and share all this information via Bluetooth, so nowadays we can use the Myo armband connected to almost, any device. Out of the box there are samples to control VLC, Spotify, or even drones or the Sphero toys. And, of course, because this is gesture based, you have a PowerPoint controller !
In order to start to use all these features as a Developer, we need to enable the Developer Mode. In the Myo preferences app, go to the General section and we need to enable the 5th option.
Now we can access the debug console which is something we can use later in our development process.
The core of the SDK is a library: libmyo. This library allows applications to interact with the Myo armband. All functionality in libmyo is exposed through a plain C API.
The SDK provides data to the application in the form of events. There are three categories of events: spatial events(corresponding to spatial data from a Myo armband), gestural events (corresponding to gestural data a Myo armband) and auxiliary events.
There is plenty of information about the internals of the SDK, but let’s go to see some code. In the SDK folder we can find the C++ header and hpp files to be used in a sample C++ app. So let’s go for this.
In a console app, we need to inherit from DeviceListener to have access to the Myo armband features.
Using the Myo hub, we can access to the EMG information, the orientation / position information and also the poses information. In example, once a pose is detected we can notify the user about this pose or take additional actions.
A nice starting point are the 3 C++ sample projects included in the SDK. However I know that not so many people are used to C++ so in my next post I’ll switch to C# thanks to one of the many Myo.Net implementations available.
Greetings @ Toronto