mirror of https://github.com/IoTcat/bedroomctl.git
parent
b323ce83a6
commit
3790095512
6 changed files with 2848 additions and 0 deletions
@ -0,0 +1,2 @@ |
||||
cache/ |
||||
compiled_files/ |
@ -0,0 +1 @@ |
||||
2772e89a406e09558835788496c56fefc86065a05ec1f1a5af158e9aebfae973 |
@ -0,0 +1 @@ |
||||
gpio.mode(4,gpio.OUTPUT);_b=db.get('_b');if _b==nil then _b=0;end;F_b=_b;_d=db.get('_d');if _d==nil then _d=0;end;F_d=_d;_f=0;_e=0;F_e=_e;_c=0;F_c=_c;_g={};_h=0;gpio.write(4,_b%2);_h=function()_d=((_e=='play')and{0}or{((_e=='stop')and{1}or{_d})[1]})[1];end;tmr.create():alarm(10,tmr.ALARM_AUTO,function()if not(F_b==_b)then gpio.write(4,_b%2);db.set('_b',_b)end;F_b=_b;if not(F_d==_d)then _f=2;db.set('_d',_d)end;F_d=_d;if not(F_e==_e)then _h();end;F_e=_e;if not(F_c==_c)then _h();end;F_c=_c;if not(_f==0)then _f=_f-1;end;if _f==1 then _b=_d;end;_e=_g.reg;_c=_g.trigger;end);node.LFS.bigiot()('21249','ee37b3a2a',_g); |
@ -0,0 +1,18 @@ |
||||
{ |
||||
"name": "bedroomctl", |
||||
"entrance": "index.js", |
||||
"director": "https://wiot-director.yimian.xyz/", |
||||
"nodes": { |
||||
"e31fd": { |
||||
"nickname": "m0", |
||||
"msgport": 6789, |
||||
"wifiIndex": 0 |
||||
} |
||||
}, |
||||
"wifi": [ |
||||
{ |
||||
"ssid": "yimian-iot", |
||||
"pwd": "1234567890." |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,21 @@ |
||||
const wiot = require('wiot'); |
||||
|
||||
|
||||
let m = []; |
||||
m[0] = new wiot.node.nodemcu('e31fd'); |
||||
|
||||
let w = []; |
||||
w[0] = new wiot.wire(0, true), |
||||
w[1] = new wiot.wire(0), |
||||
w[2] = new wiot.wire(0, true), |
||||
w[3] = new wiot.wire(); |
||||
|
||||
|
||||
wiot.gpio(m[0], wiot.OUTPUT, m[0].D4, w[0]); |
||||
|
||||
wiot.buffer(m[0], w[0], w[2]); |
||||
|
||||
wiot.bigiot(m[0], 21249, 'ee37b3a2a', w[3], w[1]); |
||||
|
||||
wiot.operate(m[0], `${wiot.if(`$1=='play'`, 0, wiot.if(`$1=='stop'`, 1, `$0`))}`, w[2], w[3], w[1]); |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue