2012-09-02 12:36:08 +00:00
|
|
|
exports.init = function(dev_id) {
|
|
|
|
var universe = new Buffer(512)
|
|
|
|
universe.fill(0)
|
|
|
|
|
|
|
|
this.update = function(u) {
|
2012-09-08 12:43:04 +00:00
|
|
|
for(var k in u) {
|
|
|
|
universe[k] = u[k]
|
|
|
|
}
|
2012-09-02 12:36:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.get = function(k) {
|
|
|
|
return universe[k];
|
|
|
|
}
|
2012-09-08 12:43:04 +00:00
|
|
|
|
|
|
|
setInterval(function() {
|
|
|
|
console.log(universe);
|
|
|
|
}, 1000);
|
2012-09-02 12:36:08 +00:00
|
|
|
return this;
|
|
|
|
}
|