Created
March 29, 2014 23:48
-
-
Save bwhite/9864925 to your computer and use it in GitHub Desktop.
[wearscript] Pebble + Myo control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<script> | |
function main() { | |
if (WS.scriptVersion(1)) return; | |
WS.subscribe("gesture:pebble:singleClick:UP", function () { | |
WS.control('SWIPE_LEFT'); | |
}); | |
WS.subscribe("gesture:pebble:singleClick:DOWN", function () { | |
WS.control('SWIPE_RIGHT'); | |
}); | |
WS.subscribe("gesture:pebble:singleClick:SELECT", function () { | |
WS.control('TAP'); | |
}); | |
WS.subscribe("gesture:pebble:longClick:SELECT", function () { | |
WS.control('SWIPE_DOWN'); | |
}); | |
WS.subscribe("gesture:myo:WAVE_IN", function () { | |
WS.control('SWIPE_LEFT'); | |
}); | |
WS.subscribe("gesture:myo:WAVE_OUT", function () { | |
WS.control('SWIPE_RIGHT'); | |
}); | |
WS.subscribe("gesture:myo:FIST", function () { | |
WS.control('TAP'); | |
}); | |
WS.subscribe("gesture:myo:FINGERS_SPREAD", function () { | |
WS.control('SWIPE_DOWN'); | |
}); | |
WS.myoPair(WS.myoTrain); | |
} | |
window.onload = main; | |
</script></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Myo and Pebble"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment