From fbe785b33c2048a20864dd236626422ee1108382 Mon Sep 17 00:00:00 2001 From: IoTcat Date: Mon, 6 May 2019 22:06:25 +0800 Subject: [PATCH] v0.0.13 mac wrong hint --- bin/core/core.a | Bin 2926170 -> 2926170 bytes node/README.md | 8 ++++---- node/app.js | 2 +- node/package.json | 2 +- node/wiot.js | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/core/core.a b/bin/core/core.a index d075e89f419b186b04bd96552e4de7f90f2a88d7..ac8b058df5e86cc6f12564396657e39c0564f161 100644 GIT binary patch delta 204 zcmW;Ew++Go07Ow4FgfRB!jW-d2?4_UumB@aoZM2egbPbZh{hu@frnrL8V(n)I^B=n z4ad!n_5D6klqzIEp6B!~)c( ywsfQ`|J{ { - if(mcu[1].read(wiot.D5) == wiot.HIGH){ - mcu[0].write(wiot.D4, wiot.HIGH); +wiot.loop([MCU0, MCU1], () => { + if(MCU1.read(wiot.D5) == wiot.HIGH){ + MCU0.write(wiot.D4, wiot.HIGH); }else{ - mcu[0].write(wiot.D4, wiot.LOW); + MCU0.write(wiot.D4, wiot.LOW); } }); diff --git a/node/app.js b/node/app.js index 831c3b7..897fc1a 100644 --- a/node/app.js +++ b/node/app.js @@ -1,5 +1,5 @@ var wiot = require('./wiot'); -MyMCU = new wiot.client({MAC: "3C:71:BF:3A:F6:CF", pin: {D4: wiot.OUTPUT},debug: 0}); +MyMCU = new wiot.client({MAC: "B4:E6:2D:6A:26:EE", pin: {D4: wiot.OUTPUT},debug: 0}); //q = new wiot.client({MAC: "3C:71:BF:3A:F6:83", pin: {D3: 1} }); wiot.begin([MyMCU], ()=>{ // 第一个参数为要等待的单片机对象数组,第二个参数为要执行的函数 // 设置计时器,每隔2000毫秒, MyMCU的3号pin口将拉高一次电平 diff --git a/node/package.json b/node/package.json index ac06872..fe8e475 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "wiot", - "version": "0.0.12", + "version": "0.0.13", "description": "An awesome iot system for web developers~", "main": "wiot.js", "scripts": { diff --git a/node/wiot.js b/node/wiot.js index 0e71409..2d8739c 100644 --- a/node/wiot.js +++ b/node/wiot.js @@ -2,7 +2,7 @@ * @Author: IoTcat (https://iotcat.me) * @Date: 2019-05-04 18:59:49 * @Last Modified by: IoTcat - * @Last Modified time: 2019-05-06 15:16:58 + * @Last Modified time: 2019-05-06 22:05:07 */ var wiot_client = function (o_params) { var o = { @@ -508,6 +508,7 @@ var wiot_client = function (o_params) { /* exc functions */ var ini = function () { if (o.hint) console.log('wiot - ' + o.MAC + ': init...'); + if(o.MAC.length != 17) throw "Wrong MAC Format!!!"; getLocalIp(); getMAC(); //ip_scan();