diff --git a/IRReceiver.h b/IRReceiver.h new file mode 100644 index 0000000..a08db2d --- /dev/null +++ b/IRReceiver.h @@ -0,0 +1,101 @@ +#ifndef IR_RECEIVER_H +#define IR_RECEIVER_H + +#include +#include + +// 红外接收结果结构体 +struct IRReceiveResult { + bool success; // 是否成功接收到信号 + uint32_t protocol; // 协议类型 + uint32_t address; // 地址码 + uint32_t command; // 命令码 + uint16_t bits; // 数据位数 + uint16_t* rawData; // 原始数据指针 + size_t rawLength; // 原始数据长度 +}; + +class IRReceiver { +private: + static uint8_t receivePin; + static bool initialized; + static uint16_t rawBuffer[RAW_BUFFER_LENGTH]; + +public: + // 初始化红外接收器 + static void init(uint8_t pin = 15); + + // 读取红外信号直到信号结束,返回读取结果 + static IRReceiveResult readIRSignal(uint32_t timeoutMs = 5000); + + // 释放资源 + static void cleanup(); +}; + +// 静态成员变量定义 +uint8_t IRReceiver::receivePin = 15; +bool IRReceiver::initialized = false; +uint16_t IRReceiver::rawBuffer[RAW_BUFFER_LENGTH]; + +// 初始化红外接收器 +void IRReceiver::init(uint8_t pin) { + receivePin = pin; + IrReceiver.begin(receivePin, ENABLE_LED_FEEDBACK); + initialized = true; +} + +// 读取红外信号直到信号结束,返回读取结果 +IRReceiveResult IRReceiver::readIRSignal(uint32_t timeoutMs) { + IRReceiveResult result = {false, 0, 0, 0, 0, nullptr, 0}; + + if (!initialized) { + return result; + } + + unsigned long startTime = millis(); + + // 等待接收到红外信号 + while (!IrReceiver.decode()) { + if (millis() - startTime > timeoutMs) { + return result; // 超时返回失败结果 + } + delay(1); + } + + // 成功接收到信号 + result.success = true; + result.protocol = IrReceiver.decodedIRData.protocol; + result.address = IrReceiver.decodedIRData.address; + result.command = IrReceiver.decodedIRData.command; + result.bits = IrReceiver.decodedIRData.numberOfBits; + + // 复制原始数据到缓冲区 + if (IrReceiver.decodedIRData.rawDataPtr != nullptr) { + result.rawLength = IrReceiver.decodedIRData.rawlen; + // 确保不超过缓冲区大小 + if (result.rawLength > RAW_BUFFER_LENGTH) { + result.rawLength = RAW_BUFFER_LENGTH; + } + + // 复制原始数据 + for (size_t i = 0; i < result.rawLength; i++) { + rawBuffer[i] = IrReceiver.decodedIRData.rawDataPtr->rawbuf[i]; + } + result.rawData = rawBuffer; + } + + // 准备接收下一个信号 + IrReceiver.resume(); + + return result; +} + +// 释放资源 +void IRReceiver::cleanup() { + if (initialized) { + IrReceiver.stop(); + initialized = false; + } +} + +#endif \ No newline at end of file diff --git a/LunarCalendarAndHolidayJudge b/LunarCalendar.h similarity index 100% rename from LunarCalendarAndHolidayJudge rename to LunarCalendar.h diff --git a/LunarCalendarAndHolidayJudge.h b/LunarCalendarAndHolidayJudge.h new file mode 100644 index 0000000..1ac696a --- /dev/null +++ b/LunarCalendarAndHolidayJudge.h @@ -0,0 +1,370 @@ +#ifndef LUNAR_CALENDAR_H +#define LUNAR_CALENDAR_H + +#include +#include + +class LunarCalendar { +private: + // 农历数据表 (1900-2100年) + static const uint32_t lunarInfo[]; + static const char* lunarMonthNames[]; + static const char* lunarDayNames[]; + static const char* tianGan[]; + static const char* diZhi[]; + static const char* animals[]; + + // 辅助函数 + static int getDaysInYear(int year); + static int getLeapMonth(int year); + static int getDaysInMonth(int year, int month, bool isLeap = false); + static bool isLeapYear(int year); + static int getDayOfYear(int year, int month, int day); + static void calculateLunar(int solarYear, int solarMonth, int solarDay, + int& lunarYear, int& lunarMonth, int& lunarDay, bool& isLeap); + +public: + // 主要转换函数 + static String solarToLunar(String solarDate); + static String getLunarYearName(int year); + static String getLunarMonthName(int month, bool isLeap = false); + static String getLunarDayName(int day); + + // 节假日判断函数 + static bool isHoliday(int year, int month, int day); + static bool isSolarHoliday(int month, int day); + static bool isLunarHoliday(int lunarYear, int lunarMonth, int lunarDay, bool isLeap); +}; + +// 农历数据表 (1900-2100年,每年用32位表示) +// 前4位表示闰月月份,后12位表示每月天数(0=29天,1=30天) +const uint32_t LunarCalendar::lunarInfo[] = { + 0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, + 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, + 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, + 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, + 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, + 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, + 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, + 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, + 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, + 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, + 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, + 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, + 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, + 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, + 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, + 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, + 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, + 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, + 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, + 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, + 0x0d520 +}; + +// 农历月份名称 +const char* LunarCalendar::lunarMonthNames[] = { + "正月", "二月", "三月", "四月", "五月", "六月", + "七月", "八月", "九月", "十月", "冬月", "腊月" +}; + +// 农历日期名称 +const char* LunarCalendar::lunarDayNames[] = { + "初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", + "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", + "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十" +}; + +// 天干 +const char* LunarCalendar::tianGan[] = { + "甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸" +}; + +// 地支 +const char* LunarCalendar::diZhi[] = { + "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥" +}; + +// 生肖 +const char* LunarCalendar::animals[] = { + "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪" +}; + +// 获取农历年总天数 +int LunarCalendar::getDaysInYear(int year) { + // 边界检查 + if (year < 1900 || year > 2100) return 365; + + int sum = 348; + for (int i = 0x8000; i > 0x8; i >>= 1) { + if ((lunarInfo[year - 1900] & i) != 0) sum += 1; + } + return sum + getDaysInMonth(year, getLeapMonth(year), true); +} + +// 获取农历年闰月月份 +int LunarCalendar::getLeapMonth(int year) { + // 边界检查 + if (year < 1900 || year > 2100) return 0; + return lunarInfo[year - 1900] & 0xf; +} + +// 获取农历月天数 +int LunarCalendar::getDaysInMonth(int year, int month, bool isLeap) { + // 边界检查 + if (year < 1900 || year > 2100 || month < 1 || month > 12) return 29; + + if (isLeap && month != getLeapMonth(year)) return 0; + if (isLeap) { + return (lunarInfo[year - 1900] & 0x10000) ? 30 : 29; + } else { + return (lunarInfo[year - 1900] & (0x10000 >> month)) ? 30 : 29; + } +} + +// 判断公历年是否为闰年 +bool LunarCalendar::isLeapYear(int year) { + return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0); +} + +// 获取公历日期在当年的天数 +int LunarCalendar::getDayOfYear(int year, int month, int day) { + int daysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + if (isLeapYear(year)) daysInMonth[1] = 29; + + int dayOfYear = day; + for (int i = 0; i < month - 1; i++) { + dayOfYear += daysInMonth[i]; + } + return dayOfYear; +} + +// 核心转换算法 +void LunarCalendar::calculateLunar(int solarYear, int solarMonth, int solarDay, + int& lunarYear, int& lunarMonth, int& lunarDay, bool& isLeap) { + // 1900年1月31日为农历1900年正月初一 + int baseYear = 1900; + int baseMonth = 1; + int baseDay = 31; + + // 计算距离基准日期的天数 + int offset = 0; + + // 计算年份差 + for (int i = baseYear; i < solarYear; i++) { + offset += isLeapYear(i) ? 366 : 365; + } + + // 加上当年已过天数 + offset += getDayOfYear(solarYear, solarMonth, solarDay) - getDayOfYear(baseYear, baseMonth, baseDay); + + // 计算农历日期 + lunarYear = baseYear; + int daysInLunarYear = getDaysInYear(lunarYear); + + while (offset >= daysInLunarYear) { + offset -= daysInLunarYear; + lunarYear++; + daysInLunarYear = getDaysInYear(lunarYear); + } + + // 计算月份 + lunarMonth = 1; + isLeap = false; + int leapMonth = getLeapMonth(lunarYear); + + while (offset > 0 && lunarMonth <= 12) { + int daysInCurrentMonth; + + if (lunarMonth == leapMonth && !isLeap && leapMonth > 0) { + // 闰月 + daysInCurrentMonth = getDaysInMonth(lunarYear, lunarMonth, true); + if (offset >= daysInCurrentMonth) { + offset -= daysInCurrentMonth; + isLeap = true; + } else { + isLeap = true; + break; + } + } + + // 正常月份 + daysInCurrentMonth = getDaysInMonth(lunarYear, lunarMonth, false); + if (offset >= daysInCurrentMonth) { + offset -= daysInCurrentMonth; + if (isLeap) { + isLeap = false; + } else { + lunarMonth++; + } + } else { + break; + } + } + + // 确保月份在有效范围内 + if (lunarMonth > 12) lunarMonth = 12; + if (lunarMonth < 1) lunarMonth = 1; + + lunarDay = offset + 1; +} + +// 主要转换函数 +String LunarCalendar::solarToLunar(String solarDate) { + // 解析输入日期 "2025/5/6" + int year, month, day; + int firstSlash = solarDate.indexOf('/'); + int secondSlash = solarDate.indexOf('/', firstSlash + 1); + + if (firstSlash == -1 || secondSlash == -1) { + return "日期格式错误"; + } + + year = solarDate.substring(0, firstSlash).toInt(); + month = solarDate.substring(firstSlash + 1, secondSlash).toInt(); + day = solarDate.substring(secondSlash + 1).toInt(); + + // 验证日期范围 + if (year < 1900 || year > 2100 || month < 1 || month > 12 || day < 1 || day > 31) { + return "日期超出范围(1900-2100)"; + } + + // 转换为农历 + int lunarYear, lunarMonth, lunarDay; + bool isLeap; + calculateLunar(year, month, day, lunarYear, lunarMonth, lunarDay, isLeap); + + // 格式化输出 + String result = getLunarYearName(lunarYear) + "年"; + result += getLunarMonthName(lunarMonth, isLeap); + result += getLunarDayName(lunarDay); + + return result; +} + +// 获取农历年份名称(天干地支+生肖) +String LunarCalendar::getLunarYearName(int year) { + int tianGanIndex = (year - 4) % 10; + int diZhiIndex = (year - 4) % 12; + + // 确保索引为正数 + if (tianGanIndex < 0) tianGanIndex += 10; + if (diZhiIndex < 0) diZhiIndex += 12; + + String yearName = String(tianGan[tianGanIndex]) + String(diZhi[diZhiIndex]); + yearName += "(" + String(animals[diZhiIndex]) + ")"; + + return yearName; +} + +// 获取农历月份名称 +String LunarCalendar::getLunarMonthName(int month, bool isLeap) { + String monthName = ""; + if (isLeap) { + monthName = "闰"; + } + // 添加边界检查 + if (month >= 1 && month <= 12) { + monthName += lunarMonthNames[month - 1]; + } else { + monthName += "未知月"; + } + return monthName; +} + +// 获取农历日期名称 +String LunarCalendar::getLunarDayName(int day) { + // 添加边界检查 + if (day >= 1 && day <= 30) { + return String(lunarDayNames[day - 1]); + } else { + return "未知日"; + } +} + +// 节假日数据结构 +struct SolarHoliday { + int month; + int day; + const char* name; +}; + +struct LunarHoliday { + int month; + int day; + const char* name; +}; + +// 公历法定节假日列表 +static const SolarHoliday solarHolidays[] = { + {1, 1, "元旦"}, + {3, 8, "妇女节"}, + {5, 1, "劳动节"}, + {6, 1, "儿童节"}, + {10, 1, "国庆节"}, + {10, 2, "国庆节"}, + {10, 3, "国庆节"} +}; + +// 农历法定节假日列表 +static const LunarHoliday lunarHolidays[] = { + {1, 1, "春节"}, + {1, 2, "春节"}, + {1, 3, "春节"}, + {1, 15, "元宵节"}, + {5, 5, "端午节"}, + {8, 15, "中秋节"}, + {9, 9, "重阳节"}, + {12, 30, "除夕"}, // 大月 + {12, 29, "除夕"} // 小月 +}; + +// 判断是否为公历节假日 +bool LunarCalendar::isSolarHoliday(int month, int day) { + int numSolarHolidays = sizeof(solarHolidays) / sizeof(solarHolidays[0]); + for (int i = 0; i < numSolarHolidays; i++) { + if (solarHolidays[i].month == month && solarHolidays[i].day == day) { + return true; + } + } + return false; +} + +// 判断是否为农历节假日 +bool LunarCalendar::isLunarHoliday(int lunarYear, int lunarMonth, int lunarDay, bool isLeap) { + // 闰月不算节假日 + if (isLeap) return false; + + int numLunarHolidays = sizeof(lunarHolidays) / sizeof(lunarHolidays[0]); + for (int i = 0; i < numLunarHolidays; i++) { + if (lunarHolidays[i].month == lunarMonth && lunarHolidays[i].day == lunarDay) { + // 特殊处理除夕:需要判断是否为该年最后一天 + if (lunarMonth == 12 && (lunarDay == 29 || lunarDay == 30)) { + int daysInLastMonth = getDaysInMonth(lunarYear, 12, false); + if (lunarDay == daysInLastMonth) { + return true; // 是除夕 + } + } else { + return true; + } + } + } + return false; +} + +// 主要节假日判断函数 +bool LunarCalendar::isHoliday(int year, int month, int day) { + // 首先检查公历节假日 + if (isSolarHoliday(month, day)) { + return true; + } + + // 检查农历节假日 + int lunarYear, lunarMonth, lunarDay; + bool isLeap; + calculateLunar(year, month, day, lunarYear, lunarMonth, lunarDay, isLeap); + + return isLunarHoliday(lunarYear, lunarMonth, lunarDay, isLeap); +} + +#endif // LUNAR_CALENDAR_H \ No newline at end of file diff --git a/红外/ir_config.bin b/红外/ir_config.bin deleted file mode 100644 index 26c9843..0000000 Binary files a/红外/ir_config.bin and /dev/null differ diff --git a/红外/ir_config.json b/红外/ir_config.json deleted file mode 100644 index 97c69c5..0000000 --- a/红外/ir_config.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "protocol_info": { - "protocol_type": "NEC", - "bits": 96 - }, - "raw_data": { - "power_on": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1807, - "timestamp": "2025-05-28 21:27:58" - }, - "power_off": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1805, - "timestamp": "2025-05-28 21:28:05" - }, - "cool_16": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1803, - "timestamp": "2025-05-28 21:28:10" - }, - "cool_17": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1805, - "timestamp": "2025-05-28 21:28:16" - }, - "cool_18": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1805, - "timestamp": "2025-05-28 21:28:20" - }, - "cool_19": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1809, - "timestamp": "2025-05-28 21:28:24" - }, - "cool_20": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1802, - "timestamp": "2025-05-28 21:28:30" - }, - "heat_16": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1801, - "timestamp": "2025-05-28 21:28:37" - }, - "heat_17": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1804, - "timestamp": "2025-05-28 21:28:44" - }, - "heat_18": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1803, - "timestamp": "2025-05-28 21:28:49" - }, - "heat_19": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1805, - "timestamp": "2025-05-28 21:28:53" - }, - "heat_20": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1801, - "timestamp": "2025-05-28 21:28:57" - }, - "mode_cool": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1804, - "timestamp": "2025-05-28 21:29:02" - }, - "mode_dry": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1811, - "timestamp": "2025-05-28 21:29:06" - }, - "mode_fan": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1809, - "timestamp": "2025-05-28 21:29:10" - }, - "up_down": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1811, - "timestamp": "2025-05-28 21:29:14" - }, - "left_right": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1807, - "timestamp": "2025-05-28 21:29:19" - }, - "fan_low": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1807, - "timestamp": "2025-05-28 21:29:23" - }, - "fan_mid": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1811, - "timestamp": "2025-05-28 21:29:26" - }, - "fan_high": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1809, - "timestamp": "2025-05-28 21:29:32" - }, - "turbo_on": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1808, - "timestamp": "2025-05-28 21:29:36" - }, - "turbo_off": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1809, - "timestamp": "2025-05-28 21:29:47" - }, - "sleep_on": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1804, - "timestamp": "2025-05-28 21:29:51" - }, - "sleep_off": { - "raw": "PULSEDISTANCE", - "protocol": 184, - "bits": 1804, - "timestamp": "2025-05-28 21:29:55" - } - } -} \ No newline at end of file diff --git a/红外/ir_controller.ino b/红外/ir_controller.ino deleted file mode 100644 index ae6d097..0000000 --- a/红外/ir_controller.ino +++ /dev/null @@ -1,40 +0,0 @@ -#include "irre.h" -#include - -#define IR_RECV_PIN 18 -#define IR_SEND_PIN 19 - -// 内存预置配置(示例NEC协议32位信号) -BinHeader configHeader = { - .protocol = 0x0001, // NEC协议编码 - .bits = 32 // 32位信号 -}; -// NEC协议空调开关信号(单位:微秒) -// 协议结构: -// [引导码]9000,4500 + -// [地址码]16位 + [反码]16位 + -// [命令码]16位 + [反码]16位 + -// [结束标志]560 -uint16_t rawData[68] = { - /*-- 引导码 --*/ 9000,4500, - /*-- 地址码 0x00FF --*/ - 560,560, 560,560, 560,560, 560,560, 560,1690, 560,560, 560,560, - /*-- 地址反码 0xFF00 --*/ - 560,560, 560,1690, 560,1690, 560,560, 560,1690, 560,1690, 560,1690, 560,560, - /*-- 命令码 0x12ED --*/ - 560,560, 560,1690, 560,560, 560,560, 560,560, 560,1690, 560,560, 560,1690, - /*-- 命令反码 + 结束符 --*/ - 560,1690, 560,1690, 560,1690, 560,1690, 560,1690, 560,39756 -}; - -void setup() { - Serial.begin(115200); - while (!Serial); - Serial.println("内存配置就绪"); -} - -void loop() { - // 发送预存的红外信号 -IrSender.sendRaw(rawData, 68, 38, IR_SEND_PIN); - delay(5000); -} \ No newline at end of file diff --git a/红外/irre(1).py b/红外/irre(1).py deleted file mode 100644 index 9bd8423..0000000 --- a/红外/irre(1).py +++ /dev/null @@ -1,206 +0,0 @@ -import os -import re -import json -import struct -from datetime import datetime - -# 常量定义 -STEPS = [ - {"desc": "1. [基础] 按电源键开机", "cmd": "power_on"}, - {"desc": "2. [基础] 按电源键关机", "cmd": "power_off"}, - *[{"desc": f"3.{i+1} [制冷] 设置{i+16}℃", "cmd": f"cool_{i+16}"} for i in range(5)],#基础温度为16 - *[{"desc": f"4.{i+1} [制热] 设置{i+16}℃", "cmd": f"heat_{i+16}"} for i in range(5)], - {"desc": "5.1 [模式] 制冷模式", "cmd": "mode_cool"}, - {"desc": "5.2 [模式] 除湿模式", "cmd": "mode_dry"}, - {"desc": "5.3 [模式] 送风模式", "cmd": "mode_fan"}, - {"desc": "5.4 [模式] 上下风", "cmd": "up_down"},#上下风 - {"desc": "6.1 [风速] 左右风", "cmd": "left_right"},#左右风 - {"desc": "6.2 [风速] 低速", "cmd": "fan_low"}, - {"desc": "6.3 [风速] 中速", "cmd": "fan_mid"}, - {"desc": "6.4 [风速] 高速", "cmd": "fan_high"}, - {"desc": "7.1 [特殊] 超强风速", "cmd": "turbo_on"},#超强风速 - {"desc": "7.2 [特殊] 静音风速", "cmd": "turbo_off"},#静音风速 - {"desc": "7.5 [特殊] 睡眠模式开", "cmd": "sleep_on"}, - {"desc": "7.6 [特殊] 睡眠模式关", "cmd": "sleep_off"}, - - - - -] - -def validate_signal(data): - """增强版信号验证""" - pattern = r""" - uint16_t\s+rawData\[(\d+)\]\s*=\s* # 匹配数组声明 - {([\d,\s]+)};?[\s\S]*? # 捕获数组内容 - Protocol\s*=\s*(\w+) # 协议类型 - (?:.*?(\d+)\s+bits)? # 可选位数匹配 - """ - match = re.search(pattern, data, re.VERBOSE | re.IGNORECASE) - - if not match: - return False, None, None, None - - try: - arr_length = int(match.group(1)) - raw_data = list(map(int, match.group(2).split(','))) - protocol = match.group(3).upper() - bits = int(match.group(4)) if match.group(4) else len(raw_data)*16 - - # 数据长度校验 - if len(raw_data) != arr_length: - print(f"数据长度不匹配: 声明{arr_length} 实际{len(raw_data)}") - return False, None, None, None - - return raw_data, protocol, bits, len(data) - except Exception as e: - print(f"解析错误: {str(e)}") - return False, None, None, None - -def analyze_signals(collected_data): - """执行控制变量分析""" - analysis = {"protocols": {}} - - # 按协议分组 - protocol_groups = {} - for cmd, data in collected_data.items(): - proto = data['protocol'] - protocol_groups.setdefault(proto, []).append(data) - - # 分析每个协议 - for proto, group in protocol_groups.items(): - proto_analysis = { - "sample_count": len(group), - "fixed_bits": [], - "variable_bits": [], - "template": [] - } - - # 位级分析 - max_length = max(len(d["raw"]) for d in group) - bit_analysis = [[] for _ in range(max_length)] - - for data in group: - for i, val in enumerate(data["raw"]): - bit_analysis[i].append(val) - - # 识别固定/可变位 - for idx, values in enumerate(bit_analysis): - unique_vals = set(values) - if len(unique_vals) == 1: - proto_analysis["fixed_bits"].append({ - "position": idx, - "value": values[0] - }) - else: - proto_analysis["variable_bits"].append({ - "position": idx, - "values": list(unique_vals) - }) - - # 生成协议模板 - proto_analysis["template"] = [ - "V" if any(idx == b["position"] for b in proto_analysis["variable_bits"]) - else group[0]["raw"][idx] - for idx in range(len(group[0]["raw"])) - ] - - analysis["protocols"][proto] = proto_analysis - - return analysis - -def collect_signals(): - """主采集流程""" - collected = {} - print("\n空调红外信号采集系统启动") - - for step_num, step in enumerate(STEPS, 1): - while True: - print(f"\n[{step_num}/{len(STEPS)}] {step['desc']}") - print("请输入红外信号数据(输入'exit'退出):") - data = input().strip() - - if data.lower() == 'exit': - if input("确认退出?(y/n): ").lower() == 'y': - save_data(collected) - return - - valid, raw, proto, bits = validate_signal(data) - if valid: - collected[step['cmd']] = { - "raw": raw, - "protocol": proto, - "bits": bits, - "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S") - } - print(f"√ 已记录:{step['cmd']}") - break - print("× 格式错误!需包含:\n1.完整C数组 2.协议信息 3.正确数据格式") - - analysis = analyze_signals(collected) - save_data(collected, analysis) - print(f"\n采集完成!有效数据:{len(collected)}条") - -def convert_to_bin(json_path): - """将JSON配置转换为二进制格式""" - with open(json_path, 'r') as f: - config = json.load(f) - - bin_data = bytearray() - for cmd in config['raw_data'].values(): - # 协议类型(4字节) + 位数(4字节) + 时间戳(12字节) - bin_data.extend(struct.pack(' -#include - -#pragma pack(push, 1) -typedef struct { - uint32_t protocol; // 协议类型 (必须与IRRemote库定义一致) - uint32_t bits; // 有效数据位数 (影响后续信号重组精度) - /* 精简后的数据结构: - * 1. 总大小8字节 (原14字节) - * 2. 删除时间戳字段后文件体积减少42% - * 3. 提升ESP32存储和传输效率 */ -} BinHeader; -#pragma pack(pop) - -class IRController { -public: - static void sendIRSignal(uint16_t* rawData, size_t length, uint8_t irPin = 4); -}; - - - -bool IRController::loadConfig(const char* path, BinHeader* header, uint16_t* rawData) { -// File file = SD.open(path); -// if(!file) return false; - -// file.read((byte*)header, sizeof(BinHeader)); -// size_t dataSize = (header->bits + 15) / 16 * 2; -// file.read((byte*)rawData, dataSize); -// file.close(); - return true; -} - -void IRController::sendIRSignal(uint16_t* rawData, size_t length, uint8_t irPin) { - IrSender.sendRaw(rawData, length, 38, false); - delay(100); -} - -#endif \ No newline at end of file diff --git a/红外/红外协议.txt b/红外/红外协议.txt deleted file mode 100644 index e961fc5..0000000 --- a/红外/红外协议.txt +++ /dev/null @@ -1,49 +0,0 @@ -[基础] 按电源键开机 uint16_t rawData[371] = {9080,4520, 580,570, 530,570, 580,570, 580,570, 530,620, 530,1720, 530,1720, 530,620, 580,570, 530,570, 580,570, 530,1770, 530,1720, 530,1720, 530,620, 530,620, 530,1720, 530,1720, 530,570, 630,520, 580,1720, 530,620, 530,570, 530,620, 530,1720, 580,570, 580,570, 530,570, 580,570, 530,1720, 580,570, 530,570, 580,620, 530,1720, 530,570, 580,1720, 530,620, 530,570, 530,570, 580,1720, 530,570, 580,620, 530,570, 580,520, 580,620, 530,570, 580,570, 530,620, 530,570, 580,570, 530,620, 530,1720, 580,1670, 580,1720, 580,1670, 580,570, 580,570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,570, 580,1670, 580,1720, 530,570, 580,570, 580,1670, 580,520, 630,520, 580,570, 580,1670, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 530,570, 580,570, 580,570, 530,620, 530,620, 530,1720, 530,620, 530,570, 530,1770, 530,570, 530,1770, 530,570, 530,620, 530,1770, 530,1720, 530,620, 480,1770, 530,620, 530,570, 530,1770, 480,1770, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,1770, 480,670, 480,1770, 480,670, 480,670, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,1770, 480,620, 530,1770, 480,620, 530,1770, 480,620, 530,1770, 480,1770, 480}; // Protocol=PulseDistance Raw-Data=0xD5000025006594 184 bits LSB first - -[基础] 按电源键关机 uint16_t rawData[371] = {9080,4520, 580,570, 530,620, 530,570, 580,570, 580,570, 530,1720, 580,1670, 580,570, 580,520, 630,570, 530,570, 530,1770, 530,1720, 580,1670, 530,620, 580,570, 530,1720, 530,1720, 580,570, 580,570, 530,1720, 530,570, 580,570, 580,570, 530,620, 530,620, 530,570, 530,570, 630,570, 530,1720, 580,570, 530,570, 580,520, 630,1670, 580,570, 580,1670, 580,570, 580,570, 530,570, 580,1720, 580,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1670, 580,1670, 630,1670, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,1670, 580,570, 580,1670, 630,1670, 580,520, 580,570, 580,1670, 630,520, 580,570, 580,520, 630,1670, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 530,570, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,670, 480,1770, 480,670, 480,1770, 480,670, 480,620, 480,1820, 480,1770, 480,670, 480,1770, 480,670, 480,620, 530,1770, 480,1770, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,1770, 480,620, 530,1770, 480,620, 530,620, 480,1770, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 430,720, 430,670, 480,670, 430,720, 430,670, 480,670, 430,720, 430,720, 430,1820, 430,720, 430,1820, 430,720, 430,1820, 430,1820, 480}; // Protocol=PulseDistance Raw-Data=0xD4000025006594 184 bits LSB first - -制冷16 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,1720, 530,570, 580,520, 630,520, 580,570, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 530,1720, 580,1670, 580,570, 580,520, 580,1720, 580,520, 580,570, 580,570, 580,1720, 530,570, 580,1720, 530,570, 580,520, 630,520, 580,570, 580,570, 580,570, 530,1720, 580,520, 580,1720, 580,520, 580,570, 580,520, 630,1670, 580,570, 580,570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,520, 630,570, 530,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,1720, 530,570, 580,1720, 530,1720, 580,1670, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 580,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 530,570, 530,620, 530,620, 530,1720, 530,620, 530,620, 530,1720, 530,620, 530,1720, 530,620, 480,620, 530,1770, 530,1720, 530,620, 530,1720, 530,620, 530,570, 530,1770, 530,1720, 530,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1770, 530,1770, 480,670, 480,670, 430,1820, 480,670, 430,670, 480}; // Protocol=PulseDistance Raw-Data=0x26000006006594 184 bits LSB first - -制冷17 uint16_t rawData[371] = {9080,4470, 630,520, 580,570, 580,520, 630,570, 530,570, 580,1720, 530,1720, 580,570, 530,570, 580,570, 580,570, 580,1670, 580,1670, 580,1720, 530,570, 580,570, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 530,570, 580,570, 580,570, 530,1720, 580,570, 530,1720, 580,570, 530,570, 580,520, 630,520, 580,570, 630,520, 580,1670, 580,570, 580,1670, 580,570, 580,570, 530,570, 580,1720, 530,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,1670, 580,570, 580,1670, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 530,570, 580,520, 630,1670, 580,570, 580,1670, 580,1720, 530,1720, 580,1670, 580,1720, 530,570, 580,520, 630,1720, 530,1720, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,1720, 530,570, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 530,1720, 530,1770, 480,620, 530,1770, 480,620, 530,620, 530,1720, 530,1770, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,670, 480,620, 530,620, 530,1770, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1820, 480,1770, 480,670, 480,1770, 480,670, 480,1770, 480,670, 480,620, 530}; // Protocol=PulseDistance Raw-Data=0x2B000001006594 184 bits LSB first - -18 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,570, 530,570, 580,570, 530,1720, 580,1720, 530,570, 580,520, 630,520, 580,570, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 580,1670, 580,1670, 580,520, 630,520, 580,1720, 580,570, 530,570, 580,570, 580,1670, 580,520, 630,1670, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 580,1720, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 580,520, 630,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,1670, 580,1720, 580,1670, 580,1670, 580,1720, 580,520, 580,570, 580,1670, 580,1720, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,570, 580,570, 580,570, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,670, 480,620, 530,620, 480,1820, 480,620, 480,670, 480,1770, 480,670, 480,1770, 480,670, 480,620, 530,1770, 480,1770, 530,620, 480,1770, 480,670, 480,670, 480,1770, 480,1770, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,1770, 480,620, 530,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,720, 430,670, 480,670, 430,670, 480,670, 430,720, 430,670, 480,670, 430,720, 430,1820, 430,720, 430,1820, 430,720, 430,1870, 380,1870, 430,720, 380,770, 380}; // Protocol=PulseDistance Raw-Data=0x35000001006594 184 bits LSB first - - -19 uint16_t rawData[371] = {9080,4520, 580,570, 530,620, 530,570, 580,570, 530,620, 530,1720, 530,1770, 530,570, 580,570, 530,620, 530,570, 530,1770, 530,1720, 580,1670, 530,620, 530,620, 530,1720, 580,1670, 580,570, 580,520, 630,1670, 530,620, 530,570, 580,570, 580,1670, 580,570, 580,1670, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 630,1670, 580,520, 580,1720, 580,520, 580,570, 580,520, 580,1720, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,1670, 580,1670, 630,1670, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1670, 580,570, 580,1670, 630,1670, 580,1670, 580,1670, 630,1670, 580,520, 630,520, 580,1720, 580,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 530,620, 580,520, 580,570, 580,570, 530,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1820, 480,620, 480,670, 480,1770, 480,670, 480,1770, 480,670, 480,620, 530,1770, 480,1770, 530,620, 480,1770, 480,670, 480,670, 480,1770, 480,1770, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,1770, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 430,720, 430,670, 480,670, 430,720, 430,1820, 430,1820, 480,1820, 430,1820, 430,1820, 480,1820, 430,670, 480,670, 430}; // Protocol=PulseDistance Raw-Data=0x3F000001006594 184 bits LSB first - -20 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 530,570, 580,570, 530,620, 530,1720, 580,1670, 580,570, 530,620, 530,570, 580,570, 580,1670, 580,1720, 530,1720, 530,620, 530,620, 530,1720, 530,1720, 530,570, 580,570, 580,1720, 530,570, 580,570, 580,520, 580,1720, 530,620, 530,1720, 580,520, 630,570, 530,570, 580,520, 580,570, 580,570, 580,1720, 530,570, 580,1720, 530,570, 580,520, 630,570, 530,1720, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,570, 580,1670, 580,1670, 580,1670, 630,1670, 580,1670, 580,570, 580,520, 630,1670, 580,1670, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,620, 530,1770, 480,620, 530,1770, 480,620, 530,620, 480,1820, 480,1770, 480,670, 480,1770, 480,670, 480,620, 480,1820, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1770, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 430,720, 430,670, 480,670, 430,720, 430,720, 430,670, 430,720, 430,720, 430,1820, 430,720, 430,670, 430,1870, 430,670, 430,720, 430,720, 430,720, 430}; // Protocol=PulseDistance Raw-Data=0x9000001006594 184 bits LSB first - -制热16 uint16_t rawData[371] = {9080,4520, 580,570, 530,570, 580,570, 580,570, 530,570, 580,1720, 530,1720, 580,570, 580,570, 530,570, 530,620, 530,1720, 530,1770, 530,1720, 530,620, 530,570, 580,1720, 530,1720, 530,620, 530,570, 580,1720, 530,570, 580,570, 530,620, 580,1670, 580,570, 530,570, 580,570, 580,570, 530,1720, 530,620, 530,620, 530,570, 580,1670, 580,570, 580,1720, 530,570, 580,520, 630,520, 580,1720, 580,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1670, 630,520, 580,1670, 630,1670, 580,520, 630,520, 580,1670, 630,520, 580,570, 580,570, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 530,570, 580,570, 580,570, 530,620, 530,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,1720, 530,620, 530,570, 530,1770, 530,620, 480,1770, 530,570, 530,620, 530,1770, 480,1770, 530,620, 480,1770, 530,620, 480,670, 480,1770, 480,1770, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,1820, 480,1770, 480,670, 480,620, 480,670, 480,620, 530,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,1770, 480,1770, 530,1770, 480,620, 530,620, 480,670, 480,1770, 480}; // Protocol=PulseDistance Raw-Data=0x8E000006006594 184 bits LSB first - -17 uint16_t rawData[371] = {9080,4520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,1720, 530,1720, 580,570, 530,570, 580,570, 580,520, 580,1720, 580,1670, 580,1720, 580,520, 580,570, 580,1670, 580,1720, 530,570, 580,570, 530,1720, 580,570, 530,570, 580,620, 530,1720, 530,570, 580,570, 580,570, 530,570, 580,1720, 530,570, 580,570, 580,520, 630,1670, 580,520, 630,1670, 580,520, 630,520, 580,570, 580,1720, 530,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1720, 580,520, 580,1720, 580,520, 580,570, 580,520, 630,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 580,520, 630,1670, 580,1670, 580,570, 580,520, 580,1720, 580,520, 580,570, 580,570, 530,1720, 530,620, 530,570, 580,570, 530,620, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,1770, 480,670, 480,620, 480,1770, 530,620, 480,1820, 480,620, 480,670, 480,1770, 530,1770, 480,620, 480,1820, 480,620, 530,620, 480,1770, 480,1820, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,1820, 430,1820, 480,670, 430,670, 480,670, 430,720, 430,670, 430,1870, 430}; // Protocol=PulseDistance Raw-Data=0x83000001006594 184 bits LSB first - -18 uint16_t rawData[371] = {9080,4520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 580,1670, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 530,570, 580,570, 580,520, 580,1720, 580,520, 580,620, 530,570, 580,520, 580,1720, 580,520, 580,620, 530,570, 580,1720, 530,570, 580,1720, 530,570, 580,520, 580,570, 580,1720, 580,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1720, 580,520, 580,1720, 580,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,570, 580,1670, 580,1720, 530,570, 580,570, 580,1670, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,1770, 480,620, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1820, 480,1770, 480,670, 480,1770, 480,670, 480,620, 480,1820, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,1770, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,670, 430,720, 430,1820, 480,670, 430,1820, 480,1770, 480,1820, 430,670, 480,670, 480,1770, 480}; // Protocol=PulseDistance Raw-Data=0x9D000001006594 184 bits LSB first - -19 uint16_t rawData[371] = {9030,4520, 580,620, 530,570, 580,570, 530,620, 530,570, 530,1770, 530,1720, 530,570, 580,570, 530,570, 630,520, 580,1720, 530,1720, 530,1770, 530,570, 580,570, 530,1720, 580,1720, 530,570, 530,570, 630,1670, 530,620, 530,620, 530,570, 580,1720, 530,570, 580,570, 580,570, 530,570, 580,1720, 530,570, 530,620, 530,620, 530,1720, 580,570, 530,1720, 580,570, 530,570, 580,520, 580,1770, 530,570, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,1720, 580,1670, 530,1770, 530,1720, 580,520, 580,570, 580,570, 580,570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,570, 580,1670, 580,1720, 530,570, 580,520, 630,1670, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,620, 530,1720, 530,620, 480,620, 530,1770, 530,1720, 530,620, 530,1720, 530,620, 530,570, 530,1770, 480,1820, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,620, 530,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,1770, 480,1770, 530,1770, 480,620, 530,1770, 480,620, 530,620, 480,1770, 530}; // Protocol=PulseDistance Raw-Data=0x97000001006594 184 bits LSB first - -20 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,1720, 580,1720, 530,570, 580,570, 580,570, 530,570, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 530,1720, 580,1670, 580,570, 580,570, 530,1720, 580,570, 530,570, 580,570, 580,1670, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,570, 580,570, 530,570, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 580,1720, 580,570, 530,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1720, 530,570, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 530,570, 580,520, 630,520, 580,1720, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,1770, 530,570, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1820, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1770, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,1820, 480,620, 480,670, 480,670, 480,670, 430,1820, 480,620, 480,1820, 480}; // Protocol=PulseDistance Raw-Data=0xA1000001006594 184 bits LSB first - -制冷模式 uint16_t rawData[371] = {9030,4570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,1720, 530,570, 580,570, 580,570, 530,570, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 530,1720, 580,1670, 630,520, 580,570, 530,1720, 580,570, 530,570, 580,570, 580,1720, 530,570, 580,1720, 530,570, 580,570, 530,620, 530,570, 580,570, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,570, 580,570, 530,1720, 580,570, 580,570, 530,570, 580,570, 580,570, 530,570, 580,570, 530,620, 530,570, 580,570, 580,570, 530,1720, 580,570, 530,1770, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,1720, 530,620, 530,1720, 530,1770, 530,1720, 530,1770, 480,1770, 530,570, 530,620, 530,1770, 480,1770, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,1770, 480,620, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,1720, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,1770, 480,1770, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 430,720, 430,670, 480,1770, 530,1770, 480,1770, 480,670, 480,620, 480,670, 480,670, 480}; // Protocol=PulseDistance Raw-Data=0xE000006006594 184 bits LSB first - -除湿 uint16_t rawData[371] = {9080,4520, 580,570, 580,520, 580,570, 580,570, 580,570, 530,1720, 580,1670, 580,570, 580,570, 580,520, 630,520, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 530,1720, 580,1670, 580,520, 630,570, 530,1720, 580,520, 580,570, 580,570, 580,1670, 580,1720, 530,1720, 580,570, 530,570, 580,570, 580,520, 580,570, 630,520, 580,1670, 580,570, 580,1720, 530,570, 580,520, 580,570, 580,1720, 580,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,520, 630,1670, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,1720, 580,520, 580,1720, 580,1670, 580,1670, 580,1670, 630,1670, 580,520, 630,520, 580,1670, 630,1670, 580,520, 630,520, 580,570, 530,570, 580,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 530,570, 580,570, 580,570, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,1720, 530,670, 480,620, 480,1820, 480,620, 480,1820, 480,620, 480,670, 480,1770, 530,1770, 480,620, 530,1770, 480,620, 530,620, 480,1770, 530,1770, 480,670, 480,620, 480,1770, 530,1770, 480,670, 480,1770, 480,620, 530,620, 480,670, 480,670, 480,1770, 480,1770, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 430,1820, 480,670, 430,1820, 480,1820, 430,720, 430}; // Protocol=PulseDistance Raw-Data=0x68000006166594 184 bits LSB first - - -送风模式 uint16_t rawData[371] = {9080,4520, 580,570, 580,520, 580,570, 580,520, 630,570, 530,1720, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,1670, 580,1720, 530,1720, 530,620, 530,570, 580,1720, 530,1720, 580,520, 580,570, 580,1720, 530,570, 580,520, 630,570, 530,1720, 580,520, 580,570, 580,1720, 530,570, 580,520, 580,570, 580,570, 580,1720, 530,570, 580,570, 580,520, 630,520, 580,570, 530,570, 580,1720, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1720, 530,570, 580,1720, 530,1720, 580,520, 580,1720, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1670, 630,520, 630,1670, 580,1670, 580,1670, 580,1720, 580,1670, 580,570, 580,520, 580,1720, 580,1670, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 580,520, 580,570, 580,570, 580,570, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,670, 480,620, 530,1770, 480,670, 480,620, 480,1770, 530,620, 480,1820, 480,620, 480,670, 480,1770, 480,1820, 480,620, 480,1820, 480,620, 480,670, 480,1770, 480,1820, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,1820, 480,1770, 480,670, 430,1820, 480,1820, 430,1820, 430,1820, 480,720, 380}; // Protocol=PulseDistance Raw-Data=0x7B000006006594 184 bits LSB first - -上下风 uint16_t rawData[371] = {9080,4520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,1670, 580,1720, 530,620, 530,570, 530,620, 530,570, 580,1720, 530,1720, 580,1670, 580,570, 580,570, 580,1670, 580,1720, 530,570, 580,520, 580,1720, 530,570, 630,520, 580,570, 530,1770, 530,570, 530,620, 580,1670, 580,570, 580,520, 580,570, 580,520, 630,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1720, 530,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,1670, 580,520, 630,1670, 580,1720, 530,570, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,1670, 580,1670, 630,1670, 580,1670, 580,1670, 630,520, 580,570, 580,1670, 580,1670, 630,520, 580,570, 530,570, 580,570, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 530,620, 530,570, 580,570, 530,620, 530,570, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 480,670, 480,1770, 530,1770, 480,620, 480,1820, 480,620, 530,1770, 480,620, 480,670, 480,1770, 530,1770, 480,620, 530,1770, 480,620, 530,620, 480,1770, 530,1770, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,1770, 530,1770, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,1820, 430,1820, 430,720, 430,1820, 430,1820, 480,1820, 430,1820, 430,720, 430}; // Protocol=PulseDistance Raw-Data=0x7B000007006595 184 bits LSB first - -左右风 uint16_t rawData[371] = {9080,4520, 580,570, 530,620, 530,570, 530,570, 580,620, 530,1720, 530,1720, 530,620, 530,570, 580,570, 580,570, 580,1720, 530,1720, 530,1720, 530,620, 530,570, 580,1720, 530,1720, 530,570, 580,620, 530,1720, 530,570, 580,570, 530,620, 530,1720, 530,620, 530,620, 530,1720, 580,570, 530,570, 530,620, 580,570, 530,1720, 580,570, 530,570, 530,620, 530,620, 530,570, 580,570, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,570, 530,570, 580,570, 580,570, 580,570, 530,1720, 580,520, 580,1720, 580,1670, 580,570, 580,1670, 580,570, 580,570, 530,570, 580,570, 580,570, 530,570, 580,520, 630,1670, 580,520, 630,1670, 580,1720, 530,1720, 580,1670, 580,1670, 580,570, 580,520, 630,1670, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 530,570, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,1720, 530,1770, 530,570, 530,1770, 480,620, 530,1770, 480,620, 530,620, 530,1720, 530,1770, 480,1770, 530,620, 480,620, 530,620, 530,1720, 530,1770, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 480,1820, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,620, 530,1770, 480,1770, 480,1770, 530,620, 480}; // Protocol=PulseDistance Raw-Data=0x72000008006395 184 bits LSB first - -低速 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,1720, 530,570, 580,570, 580,570, 530,570, 580,1720, 580,1670, 580,1670, 580,570, 580,520, 630,1670, 580,1720, 530,570, 580,520, 630,1670, 580,570, 580,570, 530,570, 580,1720, 530,570, 580,570, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 580,520, 580,1720, 580,570, 530,570, 580,520, 630,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 630,570, 530,1720, 530,570, 580,1720, 580,1670, 580,520, 580,1720, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,520, 630,1670, 580,1720, 530,1720, 580,1670, 580,1720, 530,570, 580,520, 630,1670, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 530,570, 580,570, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,570, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,1720, 530,1770, 530,570, 530,1770, 530,570, 530,1770, 530,570, 530,620, 530,1770, 480,1770, 530,1720, 530,620, 530,620, 480,670, 480,1770, 480,1770, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,1770, 480,670, 480,620, 480,670, 480,1770, 480,670, 480,620, 530,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,1770, 480,1820, 430,670, 480}; // Protocol=PulseDistance Raw-Data=0x60000011006395 184 bits LSB first - -中速 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,520, 580,620, 530,570, 530,1720, 580,1720, 530,620, 530,570, 530,620, 530,620, 530,1720, 530,1720, 530,1770, 530,570, 530,620, 580,1670, 580,1720, 530,570, 580,570, 530,1720, 580,570, 530,570, 580,570, 580,1720, 530,620, 530,570, 530,1770, 530,570, 530,620, 530,620, 530,570, 580,1720, 530,570, 580,1720, 530,1720, 580,520, 580,1720, 580,570, 530,1720, 580,570, 530,570, 580,520, 630,570, 530,570, 580,570, 580,570, 530,570, 580,570, 580,1670, 580,570, 580,1670, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1670, 630,520, 580,1670, 630,1670, 580,1670, 580,1670, 630,1670, 580,520, 580,570, 580,1670, 630,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 480,1770, 530,1720, 530,670, 480,1770, 480,670, 480,1770, 480,670, 480,620, 480,1820, 480,1770, 480,1770, 530,620, 480,670, 480,620, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1820, 480,620, 480,670, 480,670, 480,1770, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,670, 430,670, 480,1820, 430,1820, 480,1770, 480,670, 480,670, 430,670, 480,1820, 430,670, 480}; // Protocol=PulseDistance Raw-Data=0x47000011006395 184 bits LSB first - -高速 uint16_t rawData[371] = {9080,4520, 530,620, 530,620, 530,570, 530,620, 580,570, 530,1720, 530,1720, 530,620, 530,620, 530,570, 580,570, 580,1670, 580,1720, 530,1720, 580,570, 530,570, 580,1720, 530,1720, 580,570, 530,570, 580,1720, 530,570, 580,570, 580,570, 580,1670, 580,570, 580,520, 580,1720, 580,570, 530,570, 530,620, 580,570, 530,570, 580,570, 580,570, 530,570, 530,1770, 530,570, 580,1720, 530,1720, 580,570, 530,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,520, 580,1720, 580,1670, 580,570, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,1670, 580,570, 580,1670, 580,1720, 580,1670, 580,1670, 580,1720, 580,520, 580,570, 580,1670, 630,1670, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 530,620, 580,520, 580,570, 530,620, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 480,1770, 530,1720, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,1720, 530,1770, 530,570, 530,620, 530,620, 530,1720, 530,1720, 530,620, 530,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1770, 530,620, 480,670, 480,620, 530,1770, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,1770, 480,620, 530,1770, 480,1770, 480,1770, 530,620, 480,670, 480}; // Protocol=PulseDistance Raw-Data=0x3A000011006395 184 bits LSB first - -超强风速 uint16_t rawData[371] = {9130,4470, 580,620, 530,570, 530,620, 530,620, 530,570, 580,1670, 580,1720, 530,620, 530,570, 530,620, 530,620, 530,1720, 580,1670, 580,1720, 530,570, 580,570, 530,1720, 580,1720, 530,570, 580,570, 580,1670, 580,570, 530,620, 530,570, 580,1720, 530,570, 580,520, 580,1720, 580,570, 530,570, 580,570, 580,570, 580,520, 630,520, 580,1670, 580,570, 580,570, 580,1670, 580,1670, 580,1720, 530,570, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,1670, 580,570, 580,1670, 580,1670, 630,520, 580,1670, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,1670, 630,520, 580,1670, 630,1670, 580,1670, 580,1670, 630,1670, 580,520, 630,520, 580,1720, 580,1670, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,1720, 530,1770, 480,620, 530,1770, 480,620, 530,1770, 480,620, 530,620, 530,1770, 480,1770, 480,1820, 480,620, 480,670, 480,670, 480,1770, 480,1770, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,1770, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,1770, 480,1770, 480,1820, 480,620, 480,670, 480,670, 430,720, 430}; // Protocol=PulseDistance Raw-Data=0xE000011006395 184 bits LSB first - -静音风速 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,570, 530,570, 580,570, 530,1720, 580,1720, 530,620, 530,570, 530,620, 530,570, 580,1720, 530,1720, 580,1720, 530,570, 580,570, 530,1720, 580,1720, 530,570, 580,520, 630,1670, 580,570, 580,520, 580,570, 580,1720, 530,570, 580,570, 530,1720, 580,520, 630,520, 580,570, 580,570, 580,1670, 580,570, 530,570, 580,570, 580,570, 530,620, 530,570, 580,1720, 580,520, 580,570, 580,570, 530,570, 580,570, 580,520, 630,520, 580,570, 530,570, 630,1670, 580,520, 630,1670, 580,1720, 530,570, 580,1720, 530,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,1720, 530,570, 580,1720, 580,1670, 580,1670, 580,1670, 630,1670, 580,520, 580,570, 580,1670, 630,1670, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,570, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,1770, 530,1720, 530,620, 530,1720, 530,620, 530,1720, 530,620, 530,620, 480,1770, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,1770, 530,1770, 480,670, 480,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,1770, 480,670, 480,670, 480,620, 480,1820, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,1770, 480,1820, 430,670, 480,1820, 430,670, 480,1820, 430,1820, 480,670, 430}; // Protocol=PulseDistance Raw-Data=0x6B000011006395 184 bits LSB first - -睡眠模式开 uint16_t rawData[371] = {9030,4520, 630,570, 530,570, 530,620, 530,570, 580,570, 530,1770, 530,1720, 580,520, 580,570, 580,570, 530,620, 530,1720, 530,1720, 580,1720, 530,570, 580,570, 530,1770, 530,1720, 530,570, 580,570, 530,1770, 530,570, 580,520, 580,570, 580,1720, 580,520, 580,1720, 530,620, 530,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 530,620, 530,1720, 580,520, 630,520, 580,570, 530,1770, 530,570, 580,520, 580,570, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,1670, 580,570, 580,1670, 580,520, 630,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,1670, 580,520, 630,1670, 580,1720, 530,1670, 630,1670, 580,1670, 580,570, 580,520, 630,1670, 580,1670, 580,570, 580,1670, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 530,570, 580,570, 580,570, 580,520, 580,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,570, 530,620, 530,620, 530,620, 480,620, 530,620, 530,620, 480,620, 530,620, 530,570, 530,1770, 530,1720, 530,620, 530,1720, 530,620, 530,1770, 480,620, 530,620, 480,1770, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,1770, 530,1770, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 480,670, 480,1770, 480,1820, 480,620, 480,670, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,670, 430,670, 480,670, 480,1770, 480,670, 480,670, 430,670, 480,670, 430}; // Protocol=PulseDistance Raw-Data=0x8000003006395 184 bits LSB first - -睡眠模式关 uint16_t rawData[371] = {9080,4520, 580,570, 580,570, 580,570, 530,570, 580,570, 530,1720, 580,1720, 530,620, 530,570, 530,620, 530,570, 580,1720, 530,1720, 530,1720, 580,570, 530,620, 580,1670, 530,1770, 530,570, 530,620, 530,1720, 580,570, 530,620, 530,570, 580,1720, 530,570, 530,1770, 530,570, 580,570, 580,520, 580,570, 580,570, 530,620, 530,1720, 580,520, 580,1720, 530,570, 580,570, 580,570, 580,1720, 530,570, 530,570, 580,570, 580,570, 530,620, 530,570, 580,570, 530,570, 580,570, 580,570, 580,570, 530,1720, 580,570, 530,1720, 530,620, 530,620, 530,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,1720, 580,520, 580,1720, 580,1670, 580,1720, 530,1720, 530,1720, 580,570, 580,520, 580,1720, 580,1670, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,520, 580,570, 580,570, 580,520, 630,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,520, 630,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,570, 580,520, 580,1720, 530,1770, 530,570, 530,1720, 580,570, 530,1770, 480,620, 530,620, 530,1720, 530,1770, 530,1720, 530,620, 530,570, 530,620, 530,1720, 530,1770, 480,620, 530,620, 530,620, 530,570, 530,620, 530,620, 480,670, 480,670, 480,620, 530,1770, 480,1770, 480,670, 480,620, 530,620, 480,670, 480,620, 480,670, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,670, 480,620, 530,620, 480,1770, 530,1770, 480,620, 530,620, 480,670, 480,670, 480}; // Protocol=PulseDistance Raw-Data=0xC000003006395 184 bits LSB first