From 4a32c943cff0b547a1d6917b1f43ca3f4fda217a Mon Sep 17 00:00:00 2001 From: IoTcat Date: Mon, 12 Jul 2021 15:20:37 +0800 Subject: [PATCH] installed --- .wiot/compiled_files/e31fd | 2 +- index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.wiot/compiled_files/e31fd b/.wiot/compiled_files/e31fd index 34d6481..26ae6ef 100644 --- a/.wiot/compiled_files/e31fd +++ b/.wiot/compiled_files/e31fd @@ -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); \ No newline at end of file +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); \ No newline at end of file diff --git a/index.js b/index.js index 32b8b90..b5c7837 100644 --- a/index.js +++ b/index.js @@ -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]);