-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo.js
More file actions
40 lines (36 loc) · 945 Bytes
/
demo.js
File metadata and controls
40 lines (36 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//var FreestylerConnector = require("freestyler_node_connector");
var FreestylerConnector = require("./freestyler_node_connector.js");
//var api = new FreestylerConnector("localhost");
var api = new FreestylerConnector("192.168.56.101");
function createAFullSetObject(val_to_set){
var set_object = {};
for(var i=3;i!=159;i++){
set_object[i+""]=val_to_set;
}
return set_object;
}
function loop(i,max,cb){
setTimeout(function(){
cb(i);
i++;
if(i<max){
loop(i,max,cb);
}
},100);
}
api.connect().then(function(){
/*loop(1,200,function(i){
console.log("c:"+i+"v:"+5);
api.setDMX(i,5);// Sets channel 100 to value 5
});*/
/*api.setDMXFromArray({
"1":10,
"2":20
});// Set Channel 100 and 30 to value 10 and 20
Sleep(1000);*/
console.log(createAFullSetObject(100));
api.setDMXFromArray(createAFullSetObject(1));
console.log("hallo2292");
//api.setDMX(101,5);
//api.setDMX(102,6);
}).done();