|
爱科技、爱创意、爱折腾、爱极致,我们都是技术控
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 胡奚曷 于 2021-9-4 18:36 编辑
1.前言宿舍有空调,但没有遥控器
小米8手机不支持红外遥控器,只能外接USB的红外发射器
操作起来比较繁琐,因此想着DIY一个
2.硬件
由于手上有现成ESP8266 ESP-12F,38K红外接收头,红外二极管,做一个不费钱
咸鱼上6.8的艾韵的我也看了,买6个才包邮,用不上那么多,就没买
硬件设计如图,注意用AM2320的话,DATA引脚要上拉5.1K的电阻,否则不识别(图上没有,我是外挂的电阻)
DTH11可以不用上拉电阻
兼容USB C接口
打样回来
贴片焊接
全部焊好的样子
用法,接上适配器,插墙上,LED对着空调即可
3.软件
软件参考了阳阳学编程的思路
目录结构如图
文件名:IRremote.ino
代码:注意AM2320的话选dht.setup(5, DHTesp::DHT22);
- #define BLINKER_WIFI
- #define BLINKER_MIOT_OUTLET
- #include <Blinker.h>
- #include "Button.h"
- #include "DHTesp.h"
- #include "Blwifi.h"
- #include <IRsend.h>
- #include <IRrecv.h>
- #include <IRremoteESP8266.h>
- #include <IRutils.h>
- #include <LittleFS.h>
- #include <FS.h>
- // The GPIO an IR detector/demodulator is connected to. Recommended: 14
- // Note: GPIO 16 won't work on the ESP8266 as it does not have interrupts.
- const uint16_t kRecvPin = 14;
- // GPIO to use to control the IR LED circuit. Recommended: 4
- const uint16_t kIrLedPin = 4;
- // As this program is a special purpose capture/resender, let's use a larger
- // than expected buffer so we can handle very large IR messages.
- const uint16_t kCaptureBufferSize = 1024; // 1024 == ~511 bits
- // kFrequency is the modulation frequency all UNKNOWN messages will be sent at.
- const uint16_t kFrequency = 38000; // in Hz. e.g. 38kHz.
- // kTimeout is the Nr. of milli-Seconds of no-more-data before we consider a
- // message ended.
- const uint8_t kTimeout = 50; // Milli-Seconds
- // The IR transmitter.
- IRsend irsend(kIrLedPin);
- // The IR receiver.
- IRrecv irrecv(kRecvPin, kCaptureBufferSize, kTimeout, false);
- // Somewhere to store the captured message.
- decode_results results;
- const uint8_t ir_num = 10;
- const uint16_t ir_maxLength = 511;
- struct IrCodeSave
- {
- uint16_t ir_code[ir_num][ir_maxLength];
- uint16_t ir_size[ir_num];
- };
- IrCodeSave irInfo;
- BlinkerButton &GetBlButton(const uint32_t id);
- BlinkerNumber Temperature("num-tmp");
- BlinkerNumber Humidity("num-hum");
- DHTesp dht;
- bool learn = false;
- uint32_t learnID = 0;
- String btColor[ir_num]={"#ff0000","#0000FF","#FFB90F","#274e13","#274e13","#ff0000","#0000FF","#FFB90F","#274e13","#274e13"};
- bool loadConfig(FS *fs)
- {
- if (!fs->begin())
- {
- Serial.println("Unable to begin(), aborting");
- return false;
- }
- Serial.println("Reading file, may take a while...");
- long start = millis();
- File f = fs->open("/irconfig.bin", "r");
- if (!f)
- {
- Serial.println("Unable to open file for reading, aborting");
- return false;
- }
- f.read((uint8_t*)&irInfo, sizeof(IrCodeSave));
- f.close();
- long stop = millis();
- Serial.printf("==> Time to write chunks = %ld milliseconds\n", stop - start);
- return true;
- }
- bool saveConfig(FS *fs)
- {
- if (!fs->begin())
- {
- Serial.println("Unable to begin(), aborting");
- return false;
- }
- Serial.println("Creating file, may take a while...");
- long start = millis();
- File f = fs->open("/irconfig.bin", "w");
- if (!f)
- {
- Serial.println("Unable to open file for writing, aborting");
- return false;
- }
- f.write((char*)&irInfo, sizeof(IrCodeSave));
- f.close();
- long stop = millis();
- Serial.printf("==> Time to write chunks = %ld milliseconds\n", stop - start);
- return true;
- }
- uint32_t ir_rcv_delay = 0;
- void ir_loop()
- {
- if (irrecv.decode(&results))
- {
- if(ir_rcv_delay < millis())
- {
- ir_rcv_delay = millis()+1000;
- uint16_t *raw_array = resultToRawArray(&results);
- uint16_t size = getCorrectedRawLength(&results);
- BLINKER_LOG("IR size: ", size);
- if(size <= ir_maxLength && learn)
- {
- for(int i=0;i<size;i++)
- {
- irInfo.ir_code[learnID][i]=raw_array[i];
- }
- irInfo.ir_size[learnID]=size;
- }
-
- }
- String basic = resultToHumanReadableBasic(&results);
- basic.replace(" ","");
- Serial.print(basic.c_str());
- irrecv.resume();
- }
- }
- void mbt_callback(uint32_t btID)
- {
- BLINKER_LOG("long press ", btID);
- if(learn == false)
- {
- learn = true;
- GetBlButton(btID).color("#DCDCDC");
- GetBlButton(btID).print("");
- learnID = btID;
- }
- else
- {
- if(learnID == btID)
- {
- learn = false;
- GetBlButton(btID).color(btColor[btID]);
- GetBlButton(btID).print("");
- saveConfig(&LittleFS);
- }
- }
- }
- // 新建组件对象
- #define Button_Callback_Def(index,name) \
- BlinkerButton Bt##index(name); \
- Button mbt##index(mbt_callback,index,3000); \
- void button_callback##index(const String & state) \
- { \
- BLINKER_LOG("get button state: ", state); \
- mbt##index.KeyEvent(state); \
- if(state == "tap") \
- { \
- irsend.sendRaw(irInfo.ir_code[index], irInfo.ir_size[index], kFrequency); \
- } \
- }
- #define Button_Loop(index) \
- mbt##index.loop();
- #define Button_Attach(index) \
- Bt##index.attach(button_callback##index);
-
- Button_Callback_Def(0,"btn-0");
- Button_Callback_Def(1,"btn-1");
- Button_Callback_Def(2,"btn-2");
- Button_Callback_Def(3,"btn-3");
- Button_Callback_Def(4,"btn-4");
- Button_Callback_Def(5,"btn-5");
- Button_Callback_Def(6,"btn-6");
- Button_Callback_Def(7,"btn-7");
- Button_Callback_Def(8,"btn-8");
- Button_Callback_Def(9,"btn-9");
- BlinkerButton &GetBlButton(const uint32_t id)
- {
- switch(id)
- {
- case 0: return Bt0;
- case 1: return Bt1;
- case 2: return Bt2;
- case 3: return Bt3;
- case 4: return Bt4;
- case 5: return Bt5;
- case 6: return Bt6;
- case 7: return Bt7;
- case 8: return Bt8;
- case 9: return Bt9;
- default: return Bt0;
- }
- }
- void dataRead(const String & data)
- {
- BLINKER_LOG("Blinker readString: ", data);
- Blinker.vibrate();
-
- uint32_t BlinkerTime = millis();
-
- Blinker.print("millis", BlinkerTime);
- }
- float tmp;
- float hum;
- void heartbeat()
- {
- Temperature.print(tmp);
- Humidity.print(hum);
- BLINKER_LOG("heart beat temperature: ", tmp);
- BLINKER_LOG("heart beat humidity: ", hum);
- }
- void dataStorage()
- {
- Blinker.dataStorage("temp", tmp);
- Blinker.dataStorage("humi", hum);
- BLINKER_LOG("data Storage temperature: ", tmp);
- BLINKER_LOG("data Storage humidity: ", hum);
- }
- void setup()
- {
- Serial.begin(115200);
- BLINKER_DEBUG.stream(Serial);
-
- Blwifi_InitWiFi();
-
- irrecv.enableIRIn(); // Start up the IR receiver.
- irsend.begin(); // Start up the IR sender.
-
- Blinker.begin(wifiSettings.auth_key, wifiSettings.ssid, wifiSettings.pswd);
- Blinker.attachData(dataRead);
- Blinker.attachHeartbeat(heartbeat);
- dht.setup(5, DHTesp::DHT11); // Connect DHT sensor to GPIO 5
- Button_Attach(0);
- Button_Attach(1);
- Button_Attach(2);
- Button_Attach(3);
- Button_Attach(4);
- Button_Attach(5);
- Button_Attach(6);
- Button_Attach(7);
- Button_Attach(8);
- Button_Attach(9);
- Blinker.attachDataStorage(dataStorage);
- loadConfig(&LittleFS);
- }
- void loop()
- {
- float t1,h1;
- Blinker.run();
- Blwifi_Loop();
- t1=dht.getTemperature();
- h1=dht.getHumidity();
- if(t1 != -1024)
- tmp = t1;
- if(h1 != -1024)
- hum = h1;
- Button_Loop(0);
- Button_Loop(1);
- Button_Loop(2);
- Button_Loop(3);
- Button_Loop(4);
- Button_Loop(5);
- Button_Loop(6);
- Button_Loop(7);
- Button_Loop(8);
- Button_Loop(9);
- ir_loop();
- }
复制代码 文件名:GpioButton.h(这是本论坛下载的),主要用于长按按键,恢复配网用的
代码:
- #ifndef _GPIO_BUTTON_H_
- #define _GPIO_BUTTON_H_
- #include <Arduino.h>
- #define DEF_ELIMINATING_JITTER_MS 20 // default eliminating jitter ms
- #define DEF_LONG_PRESS_WAIT_MS 1000 // default long press wait ms
- #define DEF_DB_PRESS_MS 300
- class GpioButton {
- public:
- GpioButton(uint8_t gpio_pin, void(*btn_press_event)()=nullptr) :
- GpioPin(gpio_pin),
- ButtonPressEvent(btn_press_event),
- LongPressWaitMS(DEF_LONG_PRESS_WAIT_MS),
- ButtonLongPressEvent(nullptr),
- first_key_down_millis(0),
- first_key_up_millis(0),
- action_done(false),
- last_gpio_state(HIGH) {
- pinMode(GpioPin, INPUT_PULLUP);
- digitalWrite(GpioPin, HIGH);
- };
- // bind click event CB function
- void BindBtnPress(void(*btn_press_event)()) {
- ButtonPressEvent = btn_press_event;
- };
- // bind long key press CB function
- bool BindBtnLongPress(void(*btn_long_press_event)(), uint16_t wait_ms=DEF_LONG_PRESS_WAIT_MS) {
- if(wait_ms < DEF_LONG_PRESS_WAIT_MS) return false;
- ButtonLongPressEvent = btn_long_press_event;
- LongPressWaitMS = wait_ms;
- return true;
- };
- // bind double click CB function
- void BindBtnDblPress(void(*btn_dbl_press_event)()) {
- ButtonDblPressEvent = btn_dbl_press_event;
- };
- // loop function
- void loop(){
-
- uint8_t current_gpio_state = digitalRead(GpioPin);
- uint32_t current_millis = millis();
-
- // gpio status no change
- if(current_gpio_state == last_gpio_state) {
- if(current_gpio_state == LOW) {
- if(first_key_down_millis && !first_key_up_millis && (current_millis - first_key_down_millis > LongPressWaitMS)) {
- if(!action_done && ButtonLongPressEvent != nullptr) {
- ButtonLongPressEvent();
- action_done = true;
- }
- }
- }
- else {
- if(first_key_up_millis && (current_millis - first_key_up_millis > DEF_DB_PRESS_MS)) {
- if(!action_done && ButtonPressEvent != nullptr) {
- // Serial.println("Debug:Press Event.");
- ButtonPressEvent();
- action_done = true;
- }
- }
- }
- }
- // gpio status changed
- else {
- if(current_millis - last_jitter_millis > DEF_ELIMINATING_JITTER_MS) {
- // key down
- if(current_gpio_state == LOW) {
- // is first keydown in cycle
- if(0 == first_key_down_millis) {
- first_key_down_millis = current_millis;
- first_key_up_millis = 0;
- action_done = false;
- }
- // is not first key down in cycle
- else {
- // has define double click CB function
- if(nullptr != ButtonDblPressEvent){
- // key down mill - last key up mill > elimination jitter interval
- if( 0 != first_key_up_millis // is release key in event cycle
- && (current_millis - first_key_up_millis) > DEF_ELIMINATING_JITTER_MS) { // skip eliminating jitter
- // is double click?
- if( false == action_done // did in event cycle?
- && current_millis - first_key_up_millis < DEF_DB_PRESS_MS) { // and 2nd click is in interval
- // call double click event function
- // Serial.println("Debug:Double Press Event.");
- ButtonDblPressEvent();
- action_done = true;
- }
-
- }
- }
- }
- }
- // key up
- else {
- if(!action_done && first_key_down_millis && first_key_up_millis == 0) {
- first_key_up_millis = current_millis;
- }
- }
- // Keep gpio status
- last_gpio_state = current_gpio_state;
- last_jitter_millis = current_millis;
- }
- }
-
- if(action_done && current_gpio_state == HIGH) {
- // Serial.println("Event Reset.");
- first_key_down_millis = 0;
- first_key_up_millis = 0;
- action_done = false;
- }
- };
- protected:
- uint8_t GpioPin; // gpio pin of key
- void (*ButtonPressEvent)(); // Click Event CB function
- uint16_t LongPressWaitMS; // Long press ms
- void (*ButtonLongPressEvent)(); // Long press Event CB function
- void (*ButtonDblPressEvent)(); // Double click Event CB function
- uint32_t first_key_down_millis;
- uint32_t first_key_up_millis;
- bool action_done;
- uint8_t last_gpio_state;
- uint32_t last_jitter_millis;
- };
- #endif
复制代码 文件名:Button.h,用于支持Blinker按键长按
代码:
- #ifndef _BUTTON_H__
- #define _BUTTON_H__
- class Button
- {
- protected:
- void (*ButtonLongPressEvent)(uint32_t btID);
- private:
- uint32_t keyDownTime;
- uint32_t keyLongPressTime = 3000;
- String keyState = "";
- bool keyDoneFlag = false;
- uint32_t btID;
- public:
- Button(void(*btn_long_press_event)(uint32_t btID),uint32_t id,uint32_t longPressTime)
- {
- BindBtnLongPress(btn_long_press_event,id,longPressTime);
- }
- void KeyEvent(const String & state)
- {
- keyState = state;
- if(keyState == "press")
- keyDownTime = millis();
- else
- keyDoneFlag = false;
- }
- void BindBtnLongPress(void(*btn_long_press_event)(uint32_t btID),uint32_t id,uint32_t longPressTime)
- {
- ButtonLongPressEvent = btn_long_press_event;
- keyLongPressTime = longPressTime;
- btID = id;
- };
- void loop()
- {
- if(keyDoneFlag == false && keyState == "press" && (millis()-keyDownTime)>=keyLongPressTime)
- {
- keyDoneFlag = true;
- if(ButtonLongPressEvent!=nullptr)
- ButtonLongPressEvent(btID);
- }
- }
- };
- #endif
复制代码 文件名:Blwifi.h(用于配网的)
代码:
- #ifndef __BLWIFI_H__
- #define __BLWIFI_H__
- #define RESET_WIFI_PIN 0
- struct Settings
- {
- char auth_key[13];
- char ssid[128];
- char pswd[32];
- };
- extern Settings wifiSettings;
- void Blwifi_InitWiFi();
- void ClearWiFiInfo();
- void Blwifi_Loop();
- #endif
复制代码 文件名:Blwifi.cpp
代码:
- #include <WiFiManager.h>
- #include <EEPROM.h>
- #include "GpioButton.h"
- #include "Blwifi.h"
- WiFiManager wifiManager;
- // 定义按钮对象,指定按钮的GPIO口
- GpioButton myButton(RESET_WIFI_PIN);
- void ResetWifi()
- {
- for(int i=0;i<3;i++)
- {
- digitalWrite(LED_BUILTIN, LOW);
- delay(100);
- digitalWrite(LED_BUILTIN, HIGH);
- delay(400);
- }
- ClearWiFiInfo();
- wifiManager.resetSettings();
- ESP.restart();
- }
- void MyButton_Init()
- {
- // 初始化板载LED信号灯
- pinMode(LED_BUILTIN, OUTPUT);
- digitalWrite(LED_BUILTIN, HIGH);
- // 绑定按钮事件处理
- myButton.BindBtnPress([](){
- Serial.println("Button Press Event\r\n\tSetup Bind Event.");
- });
- // 绑定长按事件处理(长按判定为3000ms)
- myButton.BindBtnLongPress([]()
- {
- Serial.println("Button Long Press Event\r\n\tSetup Bind Event.");
- Serial.println(F("WiFi resetSettings."));
- ResetWifi();
- }, 3000);
- }
- bool shouldSaveConfig=false;
- Settings wifiSettings;
- void saveConfigCallback()
- {
- Serial.println("Should save config");
- shouldSaveConfig = true;
- }
- bool chkAuthkey(char* key, int len)
- {
- if (len != 12) return false;
- for (int i=0;key[i]!=0;i++){
- if (!isxdigit(key[i])) return false;
- }
- return true;
- }
- void ClearWiFiInfo()
- {
- EEPROM.begin(4096);
- EEPROM.get<Settings>(2448, wifiSettings);
- wifiSettings.auth_key[0]='\0';
- EEPROM.put<Settings>(2448, wifiSettings);
- if (EEPROM.commit())
- {
- Serial.println(F("EEPROM successfully committed"));
- }
- else
- {
- Serial.println(F("ERROR! EEPROM commit failed"));
- }
- EEPROM.end();
- }
- void Blwifi_InitWiFi()
- {
- MyButton_Init();
-
- EEPROM.begin(4096);
- EEPROM.get<Settings>(2448, wifiSettings);
- if( wifiSettings.auth_key[0]=='\0'||wifiSettings.auth_key[0]==0xFF)
- {
- WiFi.mode(WIFI_STA);
- //wifiManager.setDebugOutput(true);
-
- wifiManager.resetSettings();
- wifiManager.setAPStaticIPConfig(IPAddress(192,168,10,1), IPAddress(192,168,10,1), IPAddress(255, 255, 255, 0));
- // 3分钟配网时间,如没有完成则退出配网.
- // 例如原正常连接的WIFI路由掉线死机或不通电等情况, 通过配网超时后, 会重新进行连接原WIFI信号。 避免停在配网模式下等待
- wifiManager.setConfigPortalTimeout(180);
- //wifiManager.setConnectTimeout(240);
- // 设置点击保存的回调
- wifiManager.setSaveConfigCallback(saveConfigCallback);
- WiFiManagerParameter custom_authkey("auth_key", "Authkey", wifiSettings.auth_key, 12);
- wifiManager.addParameter(&custom_authkey);
- //AP名称:ESP_AP 密码:12345678
- if(!wifiManager.autoConnect("ESP_AP","12345678"))
- {
- Serial.println(F("Failed to connect. Reset and try again. . ."));
- ResetWifi();
- delay(5000);
- }
- Serial.println(F("Connected to Wifi."));
- Serial.print(F("My IP:"));
- Serial.println(WiFi.localIP());
- // 保存自定义信息
- if (shouldSaveConfig)
- {
- Serial.println(F("saving config..."));
- //Serial.println(custom_authkey.getValue());
- strncpy(wifiSettings.auth_key, custom_authkey.getValue(), 12);
- wifiSettings.auth_key[12] = '\0';
- strcpy(wifiSettings.ssid, wifiManager.getWiFiSSID().c_str());
- wifiSettings.ssid[wifiManager.getWiFiSSID().length()]='\0';
-
- strcpy(wifiSettings.pswd, wifiManager.getWiFiPass().c_str());
- wifiSettings.pswd[wifiManager.getWiFiPass().length()]='\0';
-
- if (!chkAuthkey(wifiSettings.auth_key, strlen(wifiSettings.auth_key)))
- {
- Serial.println(F("Authkey is wrong."));
- ResetWifi();
- delay(5000);
- }
- EEPROM.put<Settings>(2448, wifiSettings);
- if (EEPROM.commit())
- {
- Serial.println(F("EEPROM successfully committed"));
- }
- else
- {
- Serial.println(F("ERROR! EEPROM commit failed"));
- }
- }
- }
- EEPROM.end();
- wifiSettings.auth_key[12] = '\0';
- }
- void Blwifi_Loop()
- {
- myButton.loop();
- }
复制代码 注意依赖库
DHT_sensor_library_for_ESPx
IRremoteESP8266
WiFiManager
4.Blinker配置
配置界面:
界面配置代码如下
- {¨config¨{¨headerColor¨¨transparent¨¨headerStyle¨¨dark¨¨background¨{¨img¨¨assets/img/headerbg.jpg¨¨isFull¨«}}¨dashboard¨|{¨type¨¨btn¨¨ico¨¨fad fa-power-off¨¨mode¨É¨t0¨¨开启¨¨t1¨¨文本2¨¨bg¨É¨cols¨Í¨rows¨Í¨key¨¨btn-0¨´x´Ë´y´Ë¨speech¨|÷¨lstyle¨Ë¨clr¨¨#EA0909¨}{ßA¨num¨ßF¨室内温度¨ßC¨fad fa-thermometer-three-quarters¨ßQ¨#389BEE¨¨min¨É¨max¨¢1c¨uni¨¨℃ ¨ßJÉßKËßLËßM¨num-tmp¨´x´Ï´y´ËßO|÷ßPÉ}{ßAßSßF¨室内湿度¨ßC¨fad fa-humidity¨ßQßVßWÉßXº0ßY´%´ßJÉßKËßLËßM¨num-hum¨´x´É´y´ËßO|÷ßPÉ}{ßAßBßC¨fas fa-snowflakes¨ßEÉßF¨制冷¨ßHßIßJÉßKËßLËßM¨btn-1¨´x´É´y´ÍßO|÷ßQ¨#076EEF¨}{ßAßBßC¨fad fa-fire-alt¨ßEÉßF¨制热¨ßHßIßJÉßKËßLËßM¨btn-2¨´x´Ï´y´ÍßO|÷ßQ¨#FBA613¨}{ßA¨cha¨ßJɨsty¨¨line¨ßQßl¨sty1¨ßo¨clr1¨ßh¨sty2¨ßo¨clr2¨ßVßKÑßLÍßM¨cha-oh6¨´x´É´y´¤BßO|÷¨key0¨¨temp¨ßF¨温度¨¨key1¨¨humi¨ßH¨湿度¨ßPÊ}{ßAßBßC¨fad fa-cogs¨ßEÉßF¨定时2H¨ßHßIßJÉßKËßLËßM¨btn-3¨´x´Í´y´ÏßO|÷ßQ¨#00A90C¨}{ßAßBßCß10ßEÉßF¨定时3H¨ßHßIßJÉßKËßLËßM¨btn-4¨´x´Ï´y´ÏßO|÷ßQß13}{ßAßBßC¨fad fa-siren¨ßEÉßF´关闭´ßHßIßJÉßKËßLËßM¨btn-5¨´x´É´y´ÏßO|÷ßQßR}{ßAßBßCß10ßEÉßF¨定时1H¨ßHßIßJÉßKËßLËßM¨btn-6¨´x´Ë´y´ÏßO|÷ßQß13}{ßA¨tim¨ßJÉßKËßLËßM¨timing¨´x´Ì´y´ÑßO|÷ßPÉ}÷¨actions¨|{¨cmd¨{ßN¨tap¨}¨text¨¨开空调¨}{ß1D{ß17ß1E}ß1F¨关空调¨}÷¨triggers¨|÷}
复制代码 由于空调设置的值信息,如温度,风量,定时时间不好学习,所以这里就没做,因此不支持设定
5.使用方法
5.1烧录方法
(1)按住按键,给模块上电
(2)连上RX,TX到串口上
(3)Arduino上传
(4)下电重启
5.2配网方法
(1)手机搜索ESP_AP的WiFi信号,密码12345678
(2)弹出的界面上输入你家的WiFi名称和密码,再输入Blinker申请到的密钥
(3)点击Save即可完成配网
5.3学习方法
(1)设备上线后,长按需要配对的按键持续3s,按键颜色变灰
(2)遥控器对准红外接收头,按下需要学的按键
(3)长按变灰的按键,持续3s,颜色恢复正常即学习完成
(4)Blinker界面操作,看能否控制空调
(5)其他按键类似
5.4定时开启或关闭空调
(1)点击闹钟图标
(2)选择动作(开空调还是关空调)
(3)设置动作时间
5.5其他智能化场景,例如温度高自动开空调等,请自行摸索
6.原理图和代码
遥控器-原理图和代码.rar
(475.92 KB, 下载次数: 23)
7.注意事项
7.1 DHT11经常出现NA的情况,原因不明,AM2320没这个问题
可以将DHT库里的NA换成-1024,这样就不影响使用了
7.2 按键支持学习10个,学习好的信息放在FS中,EEPROM放不下
7.3 空调按键有的是组合的(如开机+设定),目前只识别首个(开机指令)
|
打赏
-
查看全部打赏
|