diff --git a/README.md b/README.md index 96b6bb0..2de65a0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The [Myo](https://www.thalmic.com) armband lets you use the electrical activity ## Download -- [Myo for Processing v0.8.0.1](download/MyoForProcessing.zip?raw=true) +- [Myo for Processing v0.8.0.2](download/MyoForProcessing.zip?raw=true) Note: If you are interested in the newest **beta** implementation, so have a look at the [development branch](https://github.com/voidplus/myo-processing/tree/dev). @@ -287,6 +287,11 @@ Don't be shy and feel free to contact me via [Twitter](http://twitter.voidplus.d ## Changelog +### 0.8.0.2 + +- Added new visual example +- Improved events for detected poses + ### 0.8.0.1 - Added support for Myo SDK version 0.8.0 diff --git a/download/MyoForProcessing.txt b/download/MyoForProcessing.txt index 3b81732..348ac2e 100644 --- a/download/MyoForProcessing.txt +++ b/download/MyoForProcessing.txt @@ -42,8 +42,8 @@ paragraph = # compare different versions of the same library, and check if an update is # available. You should think of it as a counter, counting the total number of # releases you've had. -version = 5 # This must be parsable as an int +version = 6 # This must be parsable as an int # The version as the user will see it. If blank, the version attribute will be # used here. -prettyVersion = 0.8.0.1 # This is treated as a String +prettyVersion = 0.8.0.2 # This is treated as a String diff --git a/download/MyoForProcessing.zip b/download/MyoForProcessing.zip index b775bd6..a60eee7 100644 Binary files a/download/MyoForProcessing.zip and b/download/MyoForProcessing.zip differ diff --git a/examples/e3_application/data/double_tab.png b/examples/e3_application/data/double_tab.png new file mode 100644 index 0000000..019b85c Binary files /dev/null and b/examples/e3_application/data/double_tab.png differ diff --git a/examples/e3_application/data/make_a_fist.png b/examples/e3_application/data/make_a_fist.png new file mode 100644 index 0000000..ebcc3e2 Binary files /dev/null and b/examples/e3_application/data/make_a_fist.png differ diff --git a/examples/e3_application/data/spread_fingers.png b/examples/e3_application/data/spread_fingers.png new file mode 100644 index 0000000..b2e37ef Binary files /dev/null and b/examples/e3_application/data/spread_fingers.png differ diff --git a/examples/e3_application/data/wave_left.png b/examples/e3_application/data/wave_left.png new file mode 100644 index 0000000..7d835e3 Binary files /dev/null and b/examples/e3_application/data/wave_left.png differ diff --git a/examples/e3_application/data/wave_right.png b/examples/e3_application/data/wave_right.png new file mode 100644 index 0000000..465c7ab Binary files /dev/null and b/examples/e3_application/data/wave_right.png differ diff --git a/examples/e3_application/e3_application.pde b/examples/e3_application/e3_application.pde new file mode 100644 index 0000000..a3df20b --- /dev/null +++ b/examples/e3_application/e3_application.pde @@ -0,0 +1,83 @@ +import de.voidplus.myo.*; + +Myo myo; + +PImage[] img; +boolean[] active; + +void setup() { + size(800, 200); + background(255); + // ... + + myo = new Myo(this); + // myo.setVerbose(true); + // myo.setVerboseLevel(4); // Default: 1 (1-4) + + myo.setFrequency(10); + + img = new PImage[5]; + img[0] = loadImage("data/double_tab.png"); + img[1] = loadImage("data/spread_fingers.png"); + img[2] = loadImage("data/wave_right.png"); + img[3] = loadImage("data/wave_left.png"); + img[4] = loadImage("data/make_a_fist.png"); + + active = new boolean[5]; + resetImages(); +} + +void resetImages(){ + for(int i = 0; i<5; i++){ + active[i] = false; + } +} + +void draw() { + background(255); + // ... + + for(int i = 0; i<5; i++){ + tint(255, (active[i]) ? 100 : 50); + image(img[i], ((140*i)+(i*10))+30, 30, 140, 140); + } +} + +void myoOnPose(Myo myo, long timestamp, Pose pose) { + + if(!pose.getType().toString().equals("REST")){ + resetImages(); + } + + switch (pose.getType()) { + case REST: + // resetImages(); + break; + case FIST: + active[4] = true; + myo.vibrate(); + break; + case FINGERS_SPREAD: + active[1] = true; + break; + case DOUBLE_TAP: + active[0] = true; + break; + case WAVE_IN: + active[2] = true; + break; + case WAVE_OUT: + active[3] = true; + break; + default: + break; + } +} + +void myoOnLock(Myo myo, long timestamp){ + resetImages(); +} + +void myoOnUnLock(Myo myo, long timestamp){ + resetImages(); +} diff --git a/library/MyoForProcessing.jar b/library/MyoForProcessing.jar index 8e1b9e0..74870ac 100644 Binary files a/library/MyoForProcessing.jar and b/library/MyoForProcessing.jar differ diff --git a/reference/allclasses-frame.html b/reference/allclasses-frame.html index 1ca6dc0..8055bff 100644 --- a/reference/allclasses-frame.html +++ b/reference/allclasses-frame.html @@ -2,9 +2,9 @@
- +