// 初始化有LED的IO pinMode(D2,INPUT); //将光感DO口接到D2 pinMode(D5,INPUT); //将声控的out接到D5 pinMode(D6,INPUT);//人体感应的out接到D6 pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH); // 初始化blinker Blinker.begin(auth, ssid, pswd); Button1.attach(button1...
bool WIFI_Status = true; DHT dht(DHTPIN, DHTTYPE); int32_t humi_read = 0;//湿度 小爱同学只能查整数的数据 float temp_read = 0; //温度 // 新建组件对象 BlinkerButton Button1("test"); BlinkerNumber HUMI("humi"); BlinkerNumber TEMP("temp"); int counter = 0; //配网函数 void smart...
BLINKER_DEBUG.stream(Serial); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH); //控制板子上指示灯的开是LOW,关是HIGH(默认是关,可自行修改) Blinker.begin(auth, ssid, pswd); Blinker.attachData(dataRead); BlinkerMIOT.attachPowerState(miotPowerState); BlinkerMIOT.attachQuery(miotQue...
复制 #defineBLINKER_WIFI#defineBLINKER_MIOT_SENSOR//引入小爱同学#define soilPinA0//土壤传感器脚针 DO#defineCS2//定义继电器脚针为D4#include<Blinker.h>#include<DHT.h>//DHT11传感器的头文件#defineDHTPIN4//定义DHT11模块连接管脚io4(D2脚)#defineDHTTYPEDHT11// 使用DHT11温度湿度模块,当然也可以换...
BlinkerNumber HUMI("humi"); BlinkerNumber TEMP("temp"); void button2_callback(const String & state) { digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); } void dataRead(const String & data) { BLINKER_LOG("Blinker readString: ", data); ...
pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); Blinker.begin(auth, ssid, pswd); Blinker.attachData(dataRead); Blinker.attachHeartbeat(heartbeat); Blinker.attachDataStorage(dataStorage); dht.begin(); }voidloop(){ Blinker.run();if(read_time ==0|| (millis() - read_time...
pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); Blinker.begin(auth, ssid, pswd); Blinker.attachData(dataRead); Blinker.attachHeartbeat(heartbeat); Blinker.attachDataStorage(dataStorage); dht.begin(); }voidloop(){ Blinker.run();if(read_time ==0|| (millis() - read_time...
(LED_BUILTIN,HIGH);digitalWrite(GPIO,LOW);BlinkerMIOT.powerState("off");BlinkerMIOT.print();oState=false;}}voidmiotQuery(int32_tqueryCode)//完全复制来的,写上,免得串口测试时一直提示没有…{BLINKER_LOG("MIOT Query codes: ",queryCode);switch(queryCode){caseBLINKER_CMD_QUERY_ALL_NUMBER:...
("humi",humi_read);//添加数据存储 以便于图标数据展示Blinker.dataStorage("temp",temp_read);}voidsetup(){Serial.begin(115200);BLINKER_DEBUG.stream(Serial);pinMode(LED_BUILTIN,OUTPUT);digitalWrite(LED_BUILTIN,LOW);Blinker.begin(auth,ssid,pswd);Blinker.attachData(dataRead);Blinker.attachHeart...
一个简单的ESP8266开发板,包含WS2812 RGB LED,以及SHTC3温湿度传感器,兼容ESP12F 12E 12S 07S 01S等多种型号,TypeC接口,简单好用。 封装绘制 因为ESP12F 12E 12S 07S是pin2pin兼容的,所以可以直接使用,而且我把ESP01S的封装套进焊盘框架,这样也能兼容ESP01S了,你甚至可以焊上杜邦排母,作为ESP01S烧写器使用。