main
IoTcat 3 years ago
parent 3790095512
commit 4a32c943cf
  1. 2
      .wiot/compiled_files/e31fd
  2. 4
      index.js

@ -1 +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);
gpio.mode(2,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(2,_b%2);_h=function()_d=((_e=='play')and{1}or{((_e=='stop')and{0}or{_d})[1]})[1];end;tmr.create():alarm(10,tmr.ALARM_AUTO,function()if not(F_b==_b)then gpio.write(2,_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);

@ -11,11 +11,11 @@ w[2] = new wiot.wire(0, true),
w[3] = new wiot.wire();
wiot.gpio(m[0], wiot.OUTPUT, m[0].D4, w[0]);
wiot.gpio(m[0], wiot.OUTPUT, m[0].D2, 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]);
wiot.operate(m[0], `${wiot.if(`$1=='play'`, 1, wiot.if(`$1=='stop'`, 0, `$0`))}`, w[2], w[3], w[1]);

Loading…
Cancel
Save