esp8266(可改esp32)空调遥控IC解密
- IC解密#define BLINKER_WIFI//通讯方式
- IC解密#include <Blinker.h>
- IC解密#include <IRsend.h>
- IC解密#include <IRremoteESP8266.h>
- #include <ir_Coolix.h>
- char auth[] = "";//这里填写设备密钥
- char ssid[] = "";//这里填写wifi
- char pswd[] = "";//这里填写wifi码
- //暂存温度数据
- int nowtemp = 25;
- int num_Fan = 5;
- //新建组件对象
- BlinkerNumber NUM1("settemp");//温度数据组件
- BlinkerButton Midea_power("btn-pwr");//电源开关组件
- BlinkerButton Midea_setFan("btn-fan");//风速组件
- BlinkerButton Midea_cool("btn-cool");//制冷模式组件
- BlinkerButton Midea_dry("btn-dry");//干燥模式组件
- BlinkerButton Midea_hot("btn-hot");//制热模式组件
- BlinkerButton Midea_auto("btn-auto");//自动模式组件
- BlinkerSlider Slider1("ran-wen");//温度调节滑块
- //使用ESP32的D5针脚,如果你使用的是ESP8266,则把"5"改"4"即ESP8266的D2针脚
- const uint16_t kIrLed = 5;
- IRCoolixAC ac(kIrLed);
- void printState() {
- Serial.println("Coolix A/C remote is in the following state:");
- Serial.printf(" %s\n", ac.toString().c_str());
- }
- //初始化
- void setup()
- {
- Serial.begin(115200);
- BLINKER_DEBUG.stream(Serial);
- ac.begin();
- Midea_power.attach(Midea_power_callback);
- Midea_setFan.attach(Midea_setFan_callback);
- Midea_cool.attach(Midea_cool_callback);
- Midea_dry.attach(Midea_dry_callback);
- Midea_hot.attach(Midea_hot_callback);
- Midea_auto.attach(Midea_auto_callback);
- Slider1.attach(slider1_callback);
- Serial.println("Default state of the remote.");
- printState();
- Serial.println("Setting desired state for A/C.");
- Blinker.attachHeartbeat(heartbeat);
- Blinker.begin(auth, ssid, pswd);
- }
- void loop()
- {
- Blinker.run();
- }
- //电源开关
- void Midea_power_callback(const String &state)
- {
- BLINKER_LOG("get button state: ", state);
- if (state == BLINKER_CMD_ON)
- {
- ac.on();
- ac.setMode(kCoolixCool);
- ac.setTemp(25);
- ac.send();
- Midea_power.icon("fal fa-power-off");
- Midea_power.color("#00FF00");
- Midea_power.text("开");
- Midea_power.print("on");
- }

芯片解密