Last active
December 8, 2018 07:24
-
-
Save yasugahira0810/d498a15c5198b7cc3d75347fa68dee6c 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 Example --> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script src="https://obniz.io/js/jquery-3.2.1.min.js"></script> | |
<script src="https://unpkg.com/obniz@latest/obniz.js"></script> | |
</head> | |
<body> | |
<div id="obniz-debug"></div> | |
<script> | |
var obniz = new Obniz("OBNIZ_ID"); | |
obniz.onconnect = async function () { | |
var servo = obniz.wired("ServoMotor", {signal:0,vcc:3, gnd:2}); | |
servo.angle(100.0); | |
await obniz.wait(1000); | |
servo.angle(80.0); | |
setTimeout(function(){ | |
obniz.close(); | |
if (typeof done === "function") { | |
done(); | |
} | |
},1000); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment