Permalink
Browse files

Teh functions of our doorbell arduino app

  • Loading branch information...
0 parents commit 09c44dab79671e6117a98447de22720e7be7a4b7 @reconbot committed Feb 17, 2013
Showing with 31 additions and 0 deletions.
  1. +31 −0 arduino.js
31 arduino.js
@@ -0,0 +1,31 @@
+/*global require:true module:true */
+var five = require('johnny-five');
+var board = new five.Board();
+
+var openDoor = function () {};
+
+var goDoor = function () {
+
+ var servo = new five.Servo({
+ pin: 10,
+ range: [120, 180],
+ startAt: 180
+ });
+
+ openDoor = function () {
+ servo.min();
+ setTimeout(this.max.bind(servo), 700);
+ };
+
+ board.repl.inject({
+ servo: servo
+ });
+
+};
+
+board.on("ready", goDoor);
+
+// var bigLed = new five.Led(6);
+module.exports = {
+ openDoor: openDoor
+};

0 comments on commit 09c44da

Please sign in to comment.