Do you wanna feed your pets from outdoor?
This is a feeder that can be controlled from the Web.
Cut pipes and prepare the screw.
This is a sample stl file. you can download and print this by 3D Printer. http://obniz.io/images/cookbook_3.stl
Then, Build these things and connect screw to a motor.
And put them into a box.
Connect Servo motor to an obniz.
like
Then power up your obniz.
Write code below.
Put foods to it and Try onece.
foods will be outcome.
<!-- HTML Example -->
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/obniz@2.0.2/obniz.js"></script>
</head>
<body>
<div id="obniz-debug"></div>
<br>
<div class="text-center">
<h1> Pet Feeder </h1>
</div>
<button id="meal">Feeding</button>
<div id="dispMeal"></div>
<script>
function getTime(){
var dateTime=new Date();
var hour = dateTime.getHours();
var minute = dateTime.getMinutes();
return hour + ":" + minute;
}
/* This will be over written on obniz.io webapp page */
var obniz = new Obniz("OBNIZ_ID_HERE");
obniz.onconnect = async function () {
var numberOfMeal = 0;
var lastTimeMeal;
$("#dispMeal").text("Number of feeding : "+numberOfMeal)
var servo = obniz.wired("ServoMotor", {gnd:0, vcc:1, signal:2});
$("#meal").click(async function(){
numberOfMeal++;
lastTimeMeal = getTime();
$("#dispMeal").text("Number of feeding : "+numberOfMeal+", The last time : "+lastTimeMeal)
servo.angle(0.0);
await obniz.wait(10000);
servo.angle(6.9);
})
}
</script>
</body>
</html>
The html will be opened to run a program.