Skip to content

Commit

Permalink
add fix for myo.framework handling, fix version number
Browse files Browse the repository at this point in the history
remove myo sdk link
  • Loading branch information
Darius Morawiec committed Apr 6, 2015
1 parent e765503 commit 876aed2
Show file tree
Hide file tree
Showing 25 changed files with 90 additions and 66 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Myo for Processing

Library to use the [Myo](https://www.thalmic.com) [SDK](https://developer.thalmic.com/docs/api_reference/platform/index.html) in [Processing](http://processing.org/).
Library to use the [Myo](https://www.thalmic.com) in [Processing](http://processing.org/).


## Table of Contents
Expand All @@ -23,9 +23,9 @@ The [Myo](https://www.thalmic.com) armband lets you use the electrical activity

## Download

- [Myo for Processing v0.8.2.1](download/MyoForProcessing.zip?raw=true)
- [Myo for Processing v0.8.1.2](download/MyoForProcessing.zip?raw=true)

Note: If you are interested in the newest **beta** implementation, so have a look at the **dev branch**.
Note: If you are interested in the newest **development** implementation, so have a look at the [dev branch](https://github.com/nok/myo-processing/tree/dev).


## Installation
Expand Down
2 changes: 1 addition & 1 deletion download/MyoForProcessing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ version = 12

# The version as the user will see it. If blank, the version attribute will be
# used here.
prettyVersion = 0.8.2.1
prettyVersion = 0.8.1.2

# The min and max revision of Processing compatible with your library.
# Note that these fields use the revision and not the version of Processing,
Expand Down
Binary file modified download/MyoForProcessing.zip
Binary file not shown.
Binary file modified library/MyoForProcessing.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions reference/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>All Classes (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>All Classes (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Constant Field Values (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Arm.Type.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Arm.Type (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Arm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:31 CEST 2015 -->
<title>Arm (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Collector.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Collector (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Myo.Event.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Myo.Event (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Myo.LockingPolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Myo.LockingPolicy (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Myo.Unlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Myo.Unlock (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
6 changes: 4 additions & 2 deletions reference/de/voidplus/myo/Myo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Myo (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down Expand Up @@ -96,6 +96,8 @@ <h2 title="Class Myo" class="title">Class Myo</h2>
<br>
<pre>public class <span class="strong">Myo</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Darius Morawiec</dd></dl>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Pose.Type.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Pose.Type (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/Pose.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Pose (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/package-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>de.voidplus.myo (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/de/voidplus/myo/package-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>de.voidplus.myo (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down
10 changes: 5 additions & 5 deletions reference/de/voidplus/myo/package-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>de.voidplus.myo Class Hierarchy (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
Expand Down Expand Up @@ -81,11 +81,11 @@ <h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><span class="strong">Enum</span></a>&lt;E&gt; (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>)
<ul>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Pose.Type.html" title="enum in de.voidplus.myo"><span class="strong">Pose.Type</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Arm.Type.html" title="enum in de.voidplus.myo"><span class="strong">Arm.Type</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Myo.Event.html" title="enum in de.voidplus.myo"><span class="strong">Myo.Event</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Myo.Unlock.html" title="enum in de.voidplus.myo"><span class="strong">Myo.Unlock</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Arm.Type.html" title="enum in de.voidplus.myo"><span class="strong">Arm.Type</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Myo.LockingPolicy.html" title="enum in de.voidplus.myo"><span class="strong">Myo.LockingPolicy</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Myo.Event.html" title="enum in de.voidplus.myo"><span class="strong">Myo.Event</span></a></li>
<li type="circle">de.voidplus.myo.<a href="../../../de/voidplus/myo/Pose.Type.html" title="enum in de.voidplus.myo"><span class="strong">Pose.Type</span></a></li>
</ul>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions reference/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Deprecated List (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>API Help (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions reference/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Index (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="./stylesheet.css" title="Style">
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Javadocs: MyoForProcessing</title>
<script type="text/javascript">
targetPage = "" + window.location.search;
Expand Down
4 changes: 2 additions & 2 deletions reference/overview-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Sat Feb 28 22:53:37 CET 2015 -->
<!-- Generated by javadoc (version 1.7.0_71) on Mon Apr 06 19:36:32 CEST 2015 -->
<title>Class Hierarchy (Javadocs: MyoForProcessing)</title>
<meta name="date" content="2015-02-28">
<meta name="date" content="2015-04-06">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
Expand Down
62 changes: 42 additions & 20 deletions src/de/voidplus/myo/Myo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
import processing.core.PApplet;
import processing.core.PVector;

/**
*
* @author Darius Morawiec
* @version 0.8.1.2
*
*/
public class Myo {

// Processing
Expand Down Expand Up @@ -38,32 +44,15 @@ public class Myo {
protected boolean withEmg;

private final static String NAME = "Myo";
private final static String VERSION = "0.8.2.1";
private final static String VERSION = "0.8.1.2";
private final static String MYO_SDK_VERSION = "0.8.1";
private final static String MYO_FIRMWARE_VERSION = "1.1.755";
private final static String MYO_FIRMWARE_VERSION_ALPHA = "1.1.5";
private final static String REPOSITORY = "https://github.com/nok/myo-processing";

public Myo(PApplet parent) {
PApplet.println("# "+Myo.NAME+" v"+Myo.VERSION+" - Support: Myo SDK v"+Myo.MYO_SDK_VERSION+", Firmware v"+Myo.MYO_FIRMWARE_VERSION+", Alpha Firmware v"+Myo.MYO_FIRMWARE_VERSION_ALPHA+" - "+Myo.REPOSITORY);

// Add myo.framework to Java library path manually
if (System.getProperty("os.name").toLowerCase().contains("mac")) {
try {
String framework = new File(Myo.class.getProtectionDomain()
.getCodeSource().getLocation().toURI()).getParentFile()
.toString()
+ File.separator
+ "macosx"
+ File.separator
+ "myo.framework";
System.setProperty("java.library.path", framework);
// stream = System.err;
// System.setErr(new PrintStream(new ByteArrayOutputStream()));
} catch (Exception e) {
e.printStackTrace();
}
}
this.checkDependencies();

parent.registerMethod("pre", this);
// parent.registerMethod("post", this);
Expand Down Expand Up @@ -108,7 +97,40 @@ public void run() {
this.gyroscope = new PVector();
}



// ------------------------------------------------------------------------------
// Dependencies

private void checkDependencies() {
// MAC
if (System.getProperty("os.name").toLowerCase().contains("mac")) {
// Add 'libraries/macosx' path to the 'java.library.path' to load 'myo.framework' manually
try {
String pLibPath = new File(Myo.class.getProtectionDomain()
.getCodeSource().getLocation().toURI()).getParentFile()
.toString()
+ File.separator
+ "macosx"
+ File.separator;
File pLibDir = new File(pLibPath);
if (pLibDir.exists() && pLibDir.isDirectory()) {
File myoLibFile = new File(pLibDir.getAbsoluteFile()
+ File.separator + "myo.framework");
if (myoLibFile.exists() && myoLibFile.isDirectory()) {
String libPath = System
.getProperty("java.library.path")
+ ":"
+ pLibDir.getAbsolutePath();
System.setProperty("java.library.path", libPath);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}


// ------------------------------------------------------------------------------
// Lifecycle of PApplet sketch

Expand Down

0 comments on commit 876aed2

Please sign in to comment.