Permalink
Browse files

post hackathon push

  • Loading branch information...
1 parent 42d2f10 commit 9416c15011c42b56aae89aeeb2a14417fa3cead6 @sharadmv committed Jul 23, 2012
Showing with 16 additions and 4 deletions.
  1. +8 −4 js/electrify.js
  2. +8 −0 js/main.js
  3. BIN js/temp
View
@@ -97,15 +97,19 @@ addPowerstrip(3);
var getTx = function(id) {
(function(i){
setInterval(function() {
- powerstrips[i].tx();
+ powerstrips["1"].tx();
+ powerstrips["2"].tx();
+ powerstrips["3"].tx();
}, 1000);
})(id);
};
-getTx("1");
setTimeout(function() {
- getTx("2");
+ getTx("1");
}, 250);
setTimeout(function() {
- getTx("3");
+ getTx("2");
}, 500);
+setTimeout(function() {
+ getTx("3");
+}, 750);
module.exports = interface;
View
@@ -1,3 +1,4 @@
+var net = require('net');
var express = require('express');
var electricity = require('./electrify.js');
var router = require('./router.js');
@@ -6,6 +7,13 @@ var app = express.createServer();
var sound = require('./sound.js');
var Bridge = require('bridge-js');
var bridge = new Bridge({ apiKey : "c44bcbad333664b9" });
+var server = net.createServer(function (socket) {
+ console.log("tcp");
+ electricity.toggle("3");
+});
+
+server.listen(8081, '0.0.0.0');
+
bridge.connect();
var channel;
var serviceHandler = {
View
BIN js/temp
Binary file not shown.

0 comments on commit 9416c15

Please sign in to comment.