Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!-- 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
You can’t perform that action at this time.