Created
November 20, 2015 14:56
-
-
Save stresslimit/2849cf36e2bf15af82be to your computer and use it in GitHub Desktop.
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> | |
<head> | |
<script src="http://apps.littlebitscloud.cc/api-http/littleBitsAPI.min.js"></script> | |
<script> | |
function set_auth(form) { | |
var v = { | |
access_token: form.access_token.value, | |
device_id: form.cloudBit_id.value | |
} | |
window.littleBitsAPI = littleBitsAPI.defaults(v) | |
} | |
</script> | |
</head> | |
<body> | |
<form onSubmit="event.preventDefault(); set_auth(this)"> | |
<p>token: <input name="access_token"></p> | |
<p>cloudBit id: <input name="cloudBit_id"></p> | |
<button>set auth</button> | |
</form> | |
<button onClick="littleBitsAPI.input( function(data) { | |
console.log(data.percent) | |
document.getElementById('input_display').innerHTML = data.percent | |
})">Input!</button> | |
<div id="input_display"></div> | |
<button onClick="littleBitsAPI.output()">Output!</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment