v0.0.13 mac wrong hint

master
IoTcat 5 years ago
parent b83aa84a1b
commit fbe785b33c
  1. BIN
      bin/core/core.a
  2. 8
      node/README.md
  3. 2
      node/app.js
  4. 2
      node/package.json
  5. 3
      node/wiot.js

Binary file not shown.

@ -143,11 +143,11 @@ MCU1 = new wiot.client({MAC: "xx:xx:xx:xx:xx:ww"});
// 以下代码将实现: 当MCU0的D5接收到HIGH,MCU1的D4将会输出HIGH
// 当MCU0的D5接收到LOW, MCU1的D4将会输出LOW
// 本函数接受两个参数: 第一个是MCU对象数组, 第二个是参数为MCU对象数组的函数
wiot.loop([MCU0, MCU1], (mcu) => {
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);
}
});

@ -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口将拉高一次电平

@ -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": {

@ -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();

Loading…
Cancel
Save