{"id":75383,"date":"2026-02-12T08:06:39","date_gmt":"2026-02-12T00:06:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/75383.html"},"modified":"2026-02-12T08:06:39","modified_gmt":"2026-02-12T00:06:39","slug":"stm32%e8%9c%82%e9%b8%a3%e5%99%a8%e4%b8%8eled%e5%a3%b0%e5%85%89%e6%8a%a5%e8%ad%a6%e7%b3%bb%e7%bb%9f%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/75383.html","title":{"rendered":"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0"},"content":{"rendered":"<h3>\n 1. \u8702\u9e23\u5668\u4e0eLED\u62a5\u8b66\u7cfb\u7edf\u5de5\u7a0b\u5b9e\u73b0<br \/>\n<\/h3>\n<p>\n \u5728\u667a\u80fd\u5bb6\u5c45\u7ec8\u7aef\u8bbe\u5907\u4e2d&#xff0c;\u58f0\u5149\u62a5\u8b66\u662f\u73af\u5883\u5f02\u5e38\u72b6\u6001\u6700\u76f4\u63a5\u3001\u6700\u53ef\u9760\u7684\u672c\u5730\u5316\u53cd\u9988\u673a\u5236\u3002\u672c\u8282\u5c06\u57fa\u4e8eSTM32F103C8T6\u6700\u5c0f\u7cfb\u7edf&#xff0c;\u7ed3\u5408\u539f\u7406\u56fe\u786c\u4ef6\u8bbe\u8ba1&#xff0c;\u5b8c\u6210\u8702\u9e23\u5668\u9a71\u52a8\u3001\u53cc\u8272LED\u72b6\u6001\u6307\u793a\u3001\u591a\u6761\u4ef6\u590d\u5408\u62a5\u8b66\u903b\u8f91\u53ca\u5b9a\u65f6\u5668\u9a71\u52a8\u7684PWM\u5f0f\u62a5\u8b66\u63a7\u5236\u3002\u6574\u4e2a\u5b9e\u73b0\u4e0d\u4f9d\u8d56\u4efb\u4f55\u7b2c\u4e09\u65b9GUI\u5e93\u6216\u4e0a\u5c42\u6846\u67b6&#xff0c;\u5168\u90e8\u91c7\u7528HAL\u5e93\u5e95\u5c42API\u6784\u5efa&#xff0c;\u786e\u4fdd\u4ee3\u7801\u53ef\u79fb\u690d\u6027\u4e0e\u5de5\u7a0b\u53ef\u63a7\u6027\u3002\n<\/p>\n<h4>\n 1.1 \u786c\u4ef6\u8fde\u63a5\u4e0e\u5f15\u811a\u786e\u8ba4<br \/>\n<\/h4>\n<p>\n \u6839\u636e\u539f\u7406\u56fe\u6807\u6ce8&#xff0c;\u8702\u9e23\u5668&#xff08;Buzzer&#xff09;\u9a71\u52a8\u7535\u8def\u91c7\u7528NPN\u4e09\u6781\u7ba1&#xff08;\u5982S8050&#xff09;\u6784\u6210\u7684\u53cd\u76f8\u5f00\u5173\u7ed3\u6784&#xff0c;\u5176\u57fa\u6781\u76f4\u63a5\u8fde\u63a5\u81f3MCU\u7684GPIOA_Pin0\u5f15\u811a\u3002\u8be5\u8bbe\u8ba1\u610f\u5473\u7740&#xff1a;\u5f53PA0\u8f93\u51fa\u9ad8\u7535\u5e73\u65f6&#xff0c;\u4e09\u6781\u7ba1\u5bfc\u901a&#xff0c;\u8702\u9e23\u5668\u5f97\u7535\u53d1\u58f0&#xff1b;\u5f53PA0\u8f93\u51fa\u4f4e\u7535\u5e73\u65f6&#xff0c;\u4e09\u6781\u7ba1\u622a\u6b62&#xff0c;\u8702\u9e23\u5668\u65ad\u7535\u9759\u97f3\u3002\u6b64\u4e3a\u5178\u578b\u7684\u201c\u9ad8\u7535\u5e73\u6709\u6548\u201d\u9a71\u52a8\u65b9\u5f0f\u3002\n<\/p>\n<p>\n \u540c\u65f6&#xff0c;\u7cfb\u7edf\u914d\u5907\u4e24\u9897\u72ec\u7acbLED&#xff1a;<\/p>\n<p> &#8211;<\/p>\n<p>  PC13\u5f15\u811a\u8fde\u63a5\u7eff\u8272LED<\/p>\n<p> &#xff1a;\u7528\u4e8e\u6a21\u62df\u62a5\u8b66\u89e6\u53d1\u72b6\u6001\u6307\u793a&#xff1b;<\/p>\n<p> &#8211;<\/p>\n<p>  PA1\u5f15\u811a\u8fde\u63a5\u7ea2\u8272LED<\/p>\n<p> &#xff1a;\u7528\u4e8e\u624b\u52a8\u5f00\u5173\u63a7\u5236\u72b6\u6001\u6307\u793a&#xff08;\u540e\u7eed\u6269\u5c55\u4e3a\u7528\u6237\u64cd\u4f5c\u53cd\u9988\u706f&#xff09;\u3002\n<\/p>\n<p>\n \u8be5\u786c\u4ef6\u5e03\u5c40\u5df2\u5728PCB\u5e03\u7ebf\u4e2d\u56fa\u5316&#xff0c;\u65e0\u9700\u8df3\u7ebf\u8c03\u6574\u3002\u9700\u7279\u522b\u6ce8\u610f&#xff1a;PA0\u4e0ePC13\u5747\u5c5e\u4e8e\u4e0d\u540cGPIO\u7aef\u53e3&#xff0c;\u4e14PC13\u4f4d\u4e8eC\u7aef\u53e3\u672b\u5c3e&#xff0c;\u65f6\u949f\u4f7f\u80fd\u987a\u5e8f\u4e0e\u5bc4\u5b58\u5668\u5730\u5740\u504f\u79fb\u5747\u9700\u4e25\u683c\u5bf9\u5e94&#xff0c;\u4e0d\u53ef\u6df7\u6dc6\u3002\n<\/p>\n<h4>\n 1.2 GPIO\u521d\u59cb\u5316\u914d\u7f6e<br \/>\n<\/h4>\n<p>\n \u5728<\/p>\n<p>  MX_GPIO_Init()<\/p>\n<p> \u51fd\u6570\u4e2d\u5b8c\u6210\u5168\u90e8I\/O\u521d\u59cb\u5316\u3002\u5173\u952e\u914d\u7f6e\u9879\u5982\u4e0b&#xff1a;\n<\/p>\n<p>\/\/ \u542f\u7528GPIOA\u4e0eGPIOC\u65f6\u949f<br \/>\n__HAL_RCC_GPIOA_CLK_ENABLE();<br \/>\n__HAL_RCC_GPIOC_CLK_ENABLE();<\/p>\n<p>\/\/ \u914d\u7f6ePA0\u4e3a\u63a8\u633d\u8f93\u51fa&#xff0c;\u65e0\u4e0a\u62c9\u4e0b\u62c9&#xff0c;\u9ad8\u901f\u6a21\u5f0f&#xff08;10MHz&#xff09;<br \/>\nGPIO_InitTypeDef GPIO_InitStruct &#061; {0};<br \/>\nGPIO_InitStruct.Pin &#061; GPIO_PIN_0;<br \/>\nGPIO_InitStruct.Mode &#061; GPIO_MODE_OUTPUT_PP;<br \/>\nGPIO_InitStruct.Pull &#061; GPIO_NOPULL;<br \/>\nGPIO_InitStruct.Speed &#061; GPIO_SPEED_FREQ_HIGH;<br \/>\nHAL_GPIO_Init(GPIOA, &amp;GPIO_InitStruct);<\/p>\n<p>\/\/ \u914d\u7f6ePC13\u4e3a\u63a8\u633d\u8f93\u51fa&#xff0c;\u65e0\u4e0a\u4e0b\u62c9&#xff0c;\u4e2d\u901f\u6a21\u5f0f&#xff08;2MHz&#xff09;<br \/>\nGPIO_InitStruct.Pin &#061; GPIO_PIN_13;<br \/>\nGPIO_InitStruct.Speed &#061; GPIO_SPEED_FREQ_MEDIUM;<br \/>\nHAL_GPIO_Init(GPIOC, &amp;GPIO_InitStruct);<\/p>\n<p>\/\/ \u914d\u7f6ePA1\u4e3a\u63a8\u633d\u8f93\u51fa&#xff08;\u7ea2\u706f&#xff09;&#xff0c;\u7528\u9014\u540e\u7eed\u6269\u5c55<br \/>\nGPIO_InitStruct.Pin &#061; GPIO_PIN_1;<br \/>\nHAL_GPIO_Init(GPIOA, &amp;GPIO_InitStruct);<\/p>\n<p>\n \u6b64\u5904\u901f\u5ea6\u914d\u7f6e\u5e76\u975e\u968f\u610f\u9009\u62e9&#xff1a;PA0\u9a71\u52a8\u8702\u9e23\u5668\u9700\u4e00\u5b9a\u9a71\u52a8\u80fd\u529b&#xff0c;\u9009\u7528<\/p>\n<p>  GPIO_SPEED_FREQ_HIGH<\/p>\n<p> \u786e\u4fdd\u4e0a\u5347\/\u4e0b\u964d\u6cbf\u8db3\u591f\u9661\u5ced&#xff0c;\u907f\u514d\u56e0\u8fb9\u6cbf\u7f13\u6162\u5bfc\u81f4\u8702\u9e23\u5668\u8bef\u89e6\u53d1\u6216\u58f0\u97f3\u5931\u771f&#xff1b;\u800cPC13\u4ec5\u4f5c\u72b6\u6001\u6307\u793a&#xff0c;<\/p>\n<p>  GPIO_SPEED_FREQ_MEDIUM<\/p>\n<p> \u5df2\u5b8c\u5168\u6ee1\u8db3&#xff0c;\u4e14\u53ef\u964d\u4f4e\u9ad8\u9891\u566a\u58f0\u8f90\u5c04\u3002\n<\/p>\n<p>\n \u6240\u6709\u5f15\u811a\u521d\u59cb\u7535\u5e73\u7edf\u4e00\u8bbe\u4e3a\u4f4e\u7535\u5e73&#xff08;<\/p>\n<p>  HAL_GPIO_WritePin(GPIOx, Pin, GPIO_PIN_RESET)<\/p>\n<p> &#xff09;&#xff0c;\u786e\u4fdd\u4e0a\u7535\u77ac\u95f4\u8702\u9e23\u5668\u4e0eLED\u5747\u5904\u4e8e\u5173\u95ed\u72b6\u6001&#xff0c;\u7b26\u5408\u5b89\u5168\u542f\u52a8\u89c4\u8303\u3002\n<\/p>\n<h4>\n 1.3 \u4f4d\u5e26\u64cd\u4f5c\u5c01\u88c5\u4e0e\u5feb\u901fIO\u63a7\u5236<br \/>\n<\/h4>\n<p>\n \u4e3a\u63d0\u5347\u62a5\u8b66\u54cd\u5e94\u5b9e\u65f6\u6027\u5e76\u7b80\u5316\u4ee3\u7801\u53ef\u8bfb\u6027&#xff0c;\u5f15\u5165ARM Cortex-M3\u4f4d\u5e26&#xff08;Bit-Band&#xff09;\u673a\u5236\u3002\u8be5\u673a\u5236\u5141\u8bb8\u5bf9\u5355\u4e2aGPIO\u5f15\u811a\u8fdb\u884c\u539f\u5b50\u7ea7\u8bfb\u5199&#xff0c;\u65e0\u9700\u8bfb-\u6539-\u5199\u64cd\u4f5c&#xff0c;\u5f7b\u5e95\u89c4\u907f\u591a\u4efb\u52a1\u73af\u5883\u4e0bIO\u7ade\u4e89\u98ce\u9669\u3002\n<\/p>\n<p>\n \u5728<\/p>\n<p>  bitband.h<\/p>\n<p> \u4e2d\u5b9a\u4e49\u6807\u51c6\u4f4d\u5e26\u5b8f&#xff1a;\n<\/p>\n<p>#define BITBAND_PERIPH_BASE       0x40000000U<br \/>\n#define BITBAND_SRAM_BASE         0x20000000U<br \/>\n#define PERIPH_BB_BASE            (BITBAND_PERIPH_BASE &#043; 0x02000000U)<br \/>\n#define SRAM_BB_BASE              (BITBAND_SRAM_BASE &#043; 0x01000000U)<\/p>\n<p>#define BITBAND_PERIPH(addr, bitnum) \\\\<br \/>\n    ((uint32_t)(PERIPH_BB_BASE &#043; (((uint32_t)(addr) &#8211; BITBAND_PERIPH_BASE) &lt;&lt; 5) &#043; ((bitnum) &lt;&lt; 2)))<br \/>\n#define BITBAND_SRAM(addr, bitnum) \\\\<br \/>\n    ((uint32_t)(SRAM_BB_BASE &#043; (((uint32_t)(addr) &#8211; BITBAND_SRAM_BASE) &lt;&lt; 5) &#043; ((bitnum) &lt;&lt; 2)))<\/p>\n<p>#define MEM_ADDR_TO_BITBAND_PERIPH(addr, bitnum)  \\\\<br \/>\n    *(volatile uint32_t*)BITBAND_PERIPH((addr), (bitnum))<br \/>\n#define MEM_ADDR_TO_BITBAND_SRAM(addr, bitnum)    \\\\<br \/>\n    *(volatile uint32_t*)BITBAND_SRAM((addr), (bitnum))<\/p>\n<p>\/\/ \u5feb\u901f\u8bbe\u7f6ePA0&#xff08;\u8702\u9e23\u5668&#xff09;<br \/>\n#define BUZZER_ON()   MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOA-&gt;ODR, 0) &#061; 1<br \/>\n#define BUZZER_OFF()  MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOA-&gt;ODR, 0) &#061; 0<\/p>\n<p>\/\/ \u5feb\u901f\u8bbe\u7f6ePC13&#xff08;\u7eff\u706f&#xff09;<br \/>\n#define LED_GREEN_ON()   MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOC-&gt;ODR, 13) &#061; 1<br \/>\n#define LED_GREEN_OFF()  MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOC-&gt;ODR, 13) &#061; 0<\/p>\n<p>\/\/ \u5feb\u901f\u8bbe\u7f6ePA1&#xff08;\u7ea2\u706f&#xff09;<br \/>\n#define LED_RED_ON()     MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOA-&gt;ODR, 1) &#061; 1<br \/>\n#define LED_RED_OFF()    MEM_ADDR_TO_BITBAND_PERIPH(&amp;GPIOA-&gt;ODR, 1) &#061; 0<\/p>\n<p>\n \u8be5\u5c01\u88c5\u5c06<\/p>\n<p>  GPIOx-&gt;ODR<\/p>\n<p> \u5bc4\u5b58\u5668\u7684\u67d0\u4e00\u4f4d\u6620\u5c04\u4e3a\u72ec\u7acb\u53ef\u5bfb\u5740\u768432\u4f4d\u5b57&#xff0c;\u901a\u8fc7\u4e00\u6b21\u5199\u64cd\u4f5c\u5373\u53ef\u5b8c\u6210\u5f15\u811a\u7535\u5e73\u5207\u6362&#xff0c;\u6267\u884c\u5468\u671f\u6052\u4e3a1\u4e2a\u7cfb\u7edf\u65f6\u949f\u5468\u671f&#xff0c;\u8fdc\u4f18\u4e8e<\/p>\n<p>  HAL_GPIO_WritePin()<\/p>\n<p> \u51fd\u6570\u8c03\u7528\u5f00\u9500&#xff08;\u7ea6\u6570\u5341\u4e2a\u5468\u671f&#xff09;\u3002\u5728\u62a5\u8b66\u903b\u8f91\u9ad8\u9891\u7ffb\u8f6c\u573a\u666f\u4e0b&#xff0c;\u6b64\u4f18\u5316\u53ef\u663e\u8457\u63d0\u5347\u7cfb\u7edf\u786e\u5b9a\u6027\u3002\n<\/p>\n<h4>\n 1.4 \u5b9a\u65f6\u5668\u9a71\u52a8\u7684\u8702\u9e23\u5668PWM\u63a7\u5236<br \/>\n<\/h4>\n<p>\n \u8702\u9e23\u5668\u6301\u7eed\u53d1\u58f0\u6613\u5f15\u53d1\u542c\u89c9\u75b2\u52b3\u4e14\u529f\u8017\u8f83\u9ad8&#xff0c;\u5de5\u4e1a\u7ea7\u8bbe\u8ba1\u8981\u6c42\u91c7\u7528\u8109\u51b2\u9a71\u52a8\u65b9\u5f0f\u3002\u672c\u65b9\u6848\u9009\u7528TIM3\u5b9a\u65f6\u5668\u5de5\u4f5c\u4e8e\u66f4\u65b0\u4e2d\u65ad\u6a21\u5f0f&#xff0c;\u4ea7\u751f299Hz\u65b9\u6ce2\u4fe1\u53f7\u63a7\u5236\u8702\u9e23\u5668&#xff0c;\u517c\u987e\u4eba\u8033\u654f\u611f\u9891\u6bb5&#xff08;20Hz\u201320kHz&#xff09;\u4e0eMCU\u8d44\u6e90\u5360\u7528\u7387\u3002\n<\/p>\n<h5>\n 1.4.1 TIM3\u65f6\u949f\u6811\u914d\u7f6e\u5206\u6790<br \/>\n<\/h5>\n<p>\n STM32F103C8T6\u9ed8\u8ba4HSE&#061;8MHz&#xff0c;\u7ecfPLL\u500d\u9891\u540e\u7cfb\u7edf\u65f6\u949fSYSCLK&#061;72MHz\u3002APB1\u603b\u7ebf&#xff08;TIM3\u6302\u8f7d\u4e8e\u6b64&#xff09;\u6700\u9ad8\u652f\u630136MHz&#xff0c;\u5b9e\u9645\u914d\u7f6e\u4e3a36MHz\u3002TIM3\u65f6\u949f\u6e90\u5373\u4e3aAPB1\u65f6\u949f&#xff0c;\u6545\u5176\u8ba1\u6570\u5668\u65f6\u949f\u9891\u7387\u4e3a36MHz\u3002\n<\/p>\n<p>\n \u76ee\u6807\u9891\u7387299Hz&#xff0c;\u8ba1\u7b97\u5206\u9891\u7cfb\u6570\u4e0e\u81ea\u52a8\u91cd\u88c5\u8f7d\u503c&#xff1a;<\/p>\n<p> &#8211; \u8ba1\u6570\u5668\u65f6\u949f\u9891\u7387<\/p>\n<p>  CK_CNT &#061; 36,000,000 Hz<\/p>\n<p> &#8211; \u76ee\u6807PWM\u5468\u671f<\/p>\n<p>  T_PWM &#061; 1 \/ 299 \u2248 0.003344 s &#061; 3344 \u00b5s<\/p>\n<p> &#8211; \u8ba1\u6570\u5668\u5468\u671f<\/p>\n<p>  ARR &#043; 1 &#061; CK_CNT \u00d7 T_PWM &#061; 36,000,000 \u00d7 0.003344 \u2248 120,384<\/p>\n<p>\n \u53d6\u6574\u540e\u8bbe<\/p>\n<p>  ARR &#061; 120383<\/p>\n<p> &#xff0c;\u6b64\u65f6\u5b9e\u9645\u9891\u7387\u4e3a&#xff1a;<\/p>\n<p>  f_actual &#061; 36,000,000 \/ (120383 &#043; 1) \u2248 299.0008 Hz<\/p>\n<p>\n \u8be5\u8bef\u5dee\u5c0f\u4e8e0.01%&#xff0c;\u5b8c\u5168\u6ee1\u8db3\u58f0\u5b66\u62a5\u8b66\u8981\u6c42\u3002\n<\/p>\n<h5>\n 1.4.2 TIM3\u521d\u59cb\u5316\u4ee3\u7801<br \/>\n<\/h5>\n<p>\n \u5728<\/p>\n<p>  MX_TIM3_Init()<\/p>\n<p> \u4e2d\u914d\u7f6e&#xff1a;\n<\/p>\n<p>TIM_HandleTypeDef htim3;<\/p>\n<p>void MX_TIM3_Init(void)<br \/>\n{<br \/>\n    htim3.Instance &#061; TIM3;<br \/>\n    htim3.Init.Prescaler &#061; 0;                    \/\/ \u4e0d\u9884\u5206\u9891&#xff0c;CK_CNT &#061; 36MHz<br \/>\n    htim3.Init.CounterMode &#061; TIM_COUNTERMODE_UP;<br \/>\n    htim3.Init.Period &#061; 120383;                  \/\/ \u81ea\u52a8\u91cd\u88c5\u8f7d\u503c<br \/>\n    htim3.Init.ClockDivision &#061; TIM_CLOCKDIVISION_DIV1;<br \/>\n    htim3.Init.AutoReloadPreload &#061; TIM_AUTORELOAD_PRELOAD_DISABLE;<br \/>\n    if (HAL_TIM_Base_Init(&amp;htim3) !&#061; HAL_OK)<br \/>\n    {<br \/>\n        Error_Handler();<br \/>\n    }<\/p>\n<p>    \/\/ \u4f7f\u80fdTIM3\u66f4\u65b0\u4e2d\u65ad<br \/>\n    HAL_NVIC_SetPriority(TIM3_IRQn, 5, 0);<br \/>\n    HAL_NVIC_EnableIRQ(TIM3_IRQn);<br \/>\n}<\/p>\n<p>\n \u6ce8\u610f\u4e2d\u65ad\u4f18\u5148\u7ea7\u8bbe\u4e3a5&#xff1a;\u4f4e\u4e8eSysTick&#xff08;\u9ed8\u8ba4\u4e3a0&#xff09;\u548c\u4e32\u53e3\u4e2d\u65ad&#xff08;\u901a\u5e38\u4e3a2~3&#xff09;&#xff0c;\u786e\u4fdd\u4f20\u611f\u5668\u6570\u636e\u91c7\u96c6\u4e0e\u901a\u4fe1\u4e0d\u88ab\u62a5\u8b66\u4e2d\u65ad\u963b\u585e&#xff1b;\u4f46\u9ad8\u4e8e\u666e\u901a\u4efb\u52a1\u8c03\u5ea6&#xff08;\u5982FreeRTOS PendSV\u4e3a15&#xff09;&#xff0c;\u4fdd\u969c\u62a5\u8b66\u54cd\u5e94\u53ca\u65f6\u6027\u3002\n<\/p>\n<h5>\n 1.4.3 \u4e2d\u65ad\u670d\u52a1\u51fd\u6570\u5b9e\u73b0<br \/>\n<\/h5>\n<p>  TIM3_IRQHandler<\/p>\n<p> \u4e2d\u4ec5\u6267\u884c\u6700\u7b80\u903b\u8f91&#xff1a;\n<\/p>\n<p>extern uint8_t alarm_flag;<\/p>\n<p>void TIM3_IRQHandler(void)<br \/>\n{<br \/>\n    HAL_TIM_IRQHandler(&amp;htim3);<br \/>\n}<\/p>\n<p>void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)<br \/>\n{<br \/>\n    if (htim-&gt;Instance &#061;&#061; TIM3)<br \/>\n    {<br \/>\n        if (alarm_flag)<br \/>\n        {<br \/>\n            \/\/ \u62a5\u8b66\u4f7f\u80fd\u65f6&#xff0c;\u7ffb\u8f6c\u8702\u9e23\u5668\u4e0e\u7eff\u706f<br \/>\n            BUZZER_ON();   \/\/ PA0\u7f6e\u9ad8<br \/>\n            LED_GREEN_ON(); \/\/ PC13\u7f6e\u9ad8<br \/>\n        }<br \/>\n        else<br \/>\n        {<br \/>\n            BUZZER_OFF();  \/\/ PA0\u7f6e\u4f4e<br \/>\n            LED_GREEN_OFF(); \/\/ PC13\u7f6e\u4f4e<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\n \u6b64\u5904\u5173\u952e\u70b9\u5728\u4e8e&#xff1a;\u4e2d\u65ad\u56de\u8c03\u4e2d<\/p>\n<p>  \u4e0d\u6267\u884c\u4efb\u4f55\u5ef6\u65f6\u3001\u6d6e\u70b9\u8fd0\u7b97\u6216\u590d\u6742\u5224\u65ad<\/p>\n<p> &#xff0c;\u4ec5\u505aIO\u7535\u5e73\u5207\u6362\u3002\u6240\u6709\u62a5\u8b66\u6761\u4ef6\u5224\u65ad\u5747\u5728\u4e3b\u5faa\u73af\u4e2d\u5b8c\u6210&#xff0c;\u7531<\/p>\n<p>  alarm_flag<\/p>\n<p> \u53d8\u91cf\u4f5c\u4e3a\u552f\u4e00\u540c\u6b65\u4fe1\u53f7\u3002\u8fd9\u79cd\u8bbe\u8ba1\u4e25\u683c\u9075\u5faa\u5b9e\u65f6\u7cfb\u7edf\u201c\u4e2d\u65ad\u5feb\u8fdb\u5feb\u51fa\u201d\u539f\u5219&#xff0c;\u5c06\u8017\u65f6\u903b\u8f91\u79fb\u81f3\u4e3b\u4e0a\u4e0b\u6587&#xff0c;\u907f\u514d\u4e2d\u65ad\u5d4c\u5957\u98ce\u9669\u3002\n<\/p>\n<h4>\n 1.5 \u591a\u4f20\u611f\u5668\u9608\u503c\u62a5\u8b66\u903b\u8f91\u5efa\u6a21<br \/>\n<\/h4>\n<p>\n \u62a5\u8b66\u51b3\u7b56\u57fa\u4e8e\u4e09\u7c7b\u73af\u5883\u53c2\u6570\u5b9e\u65f6\u503c&#xff1a;<\/p>\n<p> &#8211; \u6e29\u5ea6&#xff08;\u2103&#xff09;&#xff1a;\u6765\u81eaDS18B20\u6216DHT22\u7b49\u4f20\u611f\u5668&#xff0c;\u53d6\u6574\u6570\u90e8\u5206&#xff1b;<\/p>\n<p> &#8211; \u6e7f\u5ea6&#xff08;%RH&#xff09;&#xff1a;\u540c\u4e0a&#xff0c;\u53d6\u6574\u6570\u503c&#xff1b;<\/p>\n<p> &#8211; \u5149\u7167\u5f3a\u5ea6&#xff08;lux&#xff09;&#xff1a;\u6765\u81eaBH1750\u6216\u7c7b\u4f3cI\u00b2C\u4f20\u611f\u5668&#xff0c;\u5355\u4f4d\u4e3a\u6574\u6570lux\u503c\u3002\n<\/p>\n<p>\n \u8bbe\u5b9a\u62a5\u8b66\u89e6\u53d1\u6761\u4ef6\u4e3a\u4e09\u8005<\/p>\n<p>  \u4efb\u4e00<\/p>\n<p> \u8d85\u8fc7\u9608\u503c&#xff1a;<\/p>\n<p> &#8211; \u6e29\u5ea6 &gt; 30\u2103<\/p>\n<p> &#8211; \u6e7f\u5ea6 &gt; 80%RH<\/p>\n<p> &#8211; \u5149\u7167 &gt; 10000 lux\n<\/p>\n<p>\n \u6b64\u4e3a\u5178\u578b\u7684\u201c\u6216\u903b\u8f91\u201d&#xff08;OR Logic&#xff09;&#xff0c;\u6570\u5b66\u8868\u8fbe\u4e3a&#xff1a;<\/p>\n<p>  Alarm &#061; (Temp &gt; 30) \u2228 (Humidity &gt; 80) \u2228 (Light &gt; 10000)<\/p>\n<h5>\n 1.5.1 \u5e03\u5c14\u4ee3\u6570\u4f18\u5316\u4e0e\u4ee3\u7801\u5b9e\u73b0<br \/>\n<\/h5>\n<p>\n \u82e5\u6309\u76f4\u89c9\u7f16\u5199\u4e09\u5c42\u5d4c\u5957if\u8bed\u53e5&#xff0c;\u4e0d\u4ec5\u5197\u4f59\u4e14\u6613\u6f0f\u5224\u3002\u66f4\u4f18\u89e3\u662f\u5229\u7528\u5fb7\u00b7\u6469\u6839\u5b9a\u5f8b&#xff08;De Morgan\u2019s Law&#xff09;\u8f6c\u6362\u4e3a\u201c\u5168\u4e0d\u6ee1\u8db3\u5219\u4e0d\u62a5\u8b66\u201d&#xff0c;\u5373&#xff1a;\n<\/p>\n<p>  !Alarm &#061; (Temp \u2264 30) \u2227 (Humidity \u2264 80) \u2227 (Light \u2264 10000)<\/p>\n<p>  \u21d2 Alarm &#061; ![(Temp \u2264 30) \u2227 (Humidity \u2264 80) \u2227 (Light \u2264 10000)]<\/p>\n<p>\n \u6b64\u5f62\u5f0f\u4ec5\u9700\u4e00\u6b21\u903b\u8f91\u975e\u8fd0\u7b97&#xff0c;\u4e14\u6761\u4ef6\u5224\u65ad\u5929\u7136\u77ed\u8def&#xff0c;\u6548\u7387\u66f4\u9ad8\u3002\u5bf9\u5e94C\u4ee3\u7801&#xff1a;\n<\/p>\n<p>uint8_t alarm_flag &#061; 0;<\/p>\n<p>\/\/ \u5728\u4e3b\u5faa\u73af\u4e2d\u5468\u671f\u6027\u6267\u884c&#xff08;\u5982\u6bcf500ms&#xff09;<br \/>\nvoid check_alarm_conditions(void)<br \/>\n{<br \/>\n    int16_t temp &#061; get_temperature();     \/\/ \u83b7\u53d6\u6e29\u5ea6\u6574\u6570\u503c<br \/>\n    uint16_t humi &#061; get_humidity();       \/\/ \u83b7\u53d6\u6e7f\u5ea6\u6574\u6570\u503c<br \/>\n    uint32_t light &#061; get_light_lux();     \/\/ \u83b7\u53d6\u5149\u7167\u6574\u6570\u503c<\/p>\n<p>    \/\/ \u6240\u6709\u6761\u4ef6\u5747\u4e0d\u6ee1\u8db3\u65f6&#xff0c;alarm_flag &#061; 0&#xff1b;\u5426\u5219 &#061; 1<br \/>\n    alarm_flag &#061; !((temp &lt;&#061; 30) &amp;&amp; (humi &lt;&#061; 80) &amp;&amp; (light &lt;&#061; 10000));<\/p>\n<p>    \/\/ \u540c\u6b65\u66f4\u65b0\u7ea2\u706f\u72b6\u6001&#xff1a;alarm_flag\u4e3a1\u65f6\u7ea2\u706f\u4eae&#xff08;\u624b\u52a8\u5f00\u5173\u6307\u793a&#xff09;<br \/>\n    if (alarm_flag)<br \/>\n    {<br \/>\n        LED_RED_ON();<br \/>\n    }<br \/>\n    else<br \/>\n    {<br \/>\n        LED_RED_OFF();<br \/>\n    }<br \/>\n}<\/p>\n<p>\n \u8be5\u5b9e\u73b0\u5177\u6709\u4ee5\u4e0b\u4f18\u52bf&#xff1a;<\/p>\n<p> &#8211;<\/p>\n<p>  \u65e0\u5206\u652f\u9884\u6d4b\u5931\u8d25<\/p>\n<p> &#xff1a;\u73b0\u4ee3ARM\u5904\u7406\u5668\u5bf9<\/p>\n<p>  &amp;&amp;<\/p>\n<p> \u77ed\u8def\u6c42\u503c\u4f18\u5316\u6781\u4f73&#xff0c;\u5f53<\/p>\n<p>  temp &lt;&#061; 30<\/p>\n<p> \u4e3a\u5047\u65f6&#xff0c;\u540e\u7eed\u6761\u4ef6\u4e0d\u518d\u8ba1\u7b97&#xff1b;<\/p>\n<p> &#8211;<\/p>\n<p>  \u5185\u5b58\u8bbf\u95ee\u5c40\u90e8\u6027\u597d<\/p>\n<p> &#xff1a;\u4e09\u4e2a\u53d8\u91cf\u5747\u4e3a\u6574\u578b&#xff0c;\u8fde\u7eed\u5b58\u50a8\u6216\u5bc4\u5b58\u5668\u5206\u914d&#xff0c;\u7f13\u5b58\u547d\u4e2d\u7387\u9ad8&#xff1b;<\/p>\n<p> &#8211;<\/p>\n<p>  \u53ef\u6269\u5c55\u6027\u5f3a<\/p>\n<p> &#xff1a;\u65b0\u589e\u4f20\u611f\u5668\u6761\u4ef6\u53ea\u9700\u5728<\/p>\n<p>  &amp;&amp;<\/p>\n<p> \u94fe\u4e2d\u8ffd\u52a0<\/p>\n<p>  (new_sensor &lt;&#061; threshold)<\/p>\n<p> \u5373\u53ef\u3002\n<\/p>\n<h5>\n 1.5.2 \u5b9e\u9645\u90e8\u7f72\u4e2d\u7684\u8fb9\u754c\u5904\u7406<br \/>\n<\/h5>\n<p>\n \u771f\u5b9e\u4f20\u611f\u5668\u6570\u636e\u5b58\u5728\u566a\u58f0\u4e0e\u6f02\u79fb&#xff0c;\u76f4\u63a5\u6bd4\u8f83\u539f\u59cb\u503c\u6613\u5bfc\u81f4\u8bef\u62a5\u3002\u5de5\u7a0b\u5b9e\u8df5\u4e2d\u5fc5\u987b\u52a0\u5165\u8f6f\u4ef6\u6ee4\u6ce2&#xff1a;\n<\/p>\n<p>#define TEMP_FILTER_DEPTH 5<br \/>\n#define HUMI_FILTER_DEPTH 5<br \/>\n#define LIGHT_FILTER_DEPTH 3<\/p>\n<p>int16_t temp_filter[TEMP_FILTER_DEPTH] &#061; {0};<br \/>\nuint16_t humi_filter[HUMI_FILTER_DEPTH] &#061; {0};<br \/>\nuint32_t light_filter[LIGHT_FILTER_DEPTH] &#061; {0};<br \/>\nuint8_t filter_idx &#061; 0;<\/p>\n<p>void update_sensor_filters(int16_t t, uint16_t h, uint32_t l)<br \/>\n{<br \/>\n    temp_filter[filter_idx] &#061; t;<br \/>\n    humi_filter[filter_idx] &#061; h;<br \/>\n    light_filter[filter_idx] &#061; l;<\/p>\n<p>    filter_idx &#061; (filter_idx &#043; 1) % TEMP_FILTER_DEPTH;<\/p>\n<p>    \/\/ \u4e2d\u503c\u6ee4\u6ce2&#xff1a;\u53d6\u6570\u7ec4\u6392\u5e8f\u540e\u4e2d\u95f4\u503c<br \/>\n    int16_t temp_sorted[TEMP_FILTER_DEPTH];<br \/>\n    memcpy(temp_sorted, temp_filter, sizeof(temp_filter));<br \/>\n    qsort(temp_sorted, TEMP_FILTER_DEPTH, sizeof(int16_t), compare_int16);<\/p>\n<p>    int16_t filtered_temp &#061; temp_sorted[TEMP_FILTER_DEPTH\/2];<br \/>\n    uint16_t filtered_humi &#061; get_median_uint16(humi_filter, HUMI_FILTER_DEPTH);<br \/>\n    uint32_t filtered_light &#061; get_median_uint32(light_filter, LIGHT_FILTER_DEPTH);<\/p>\n<p>    \/\/ \u4f7f\u7528\u6ee4\u6ce2\u540e\u503c\u53c2\u4e0e\u62a5\u8b66\u5224\u65ad<br \/>\n    alarm_flag &#061; !((filtered_temp &lt;&#061; 30) &amp;&amp; (filtered_humi &lt;&#061; 80) &amp;&amp; (filtered_light &lt;&#061; 10000));<br \/>\n}<\/p>\n<p>\n \u4e2d\u503c\u6ee4\u6ce2\u5bf9\u8109\u51b2\u566a\u58f0\u6291\u5236\u6548\u679c\u663e\u8457&#xff0c;\u4e14\u8ba1\u7b97\u590d\u6742\u5ea6\u8fdc\u4f4e\u4e8e\u5361\u5c14\u66fc\u6ee4\u6ce2&#xff0c;\u9002\u5408\u8d44\u6e90\u53d7\u9650\u7684Cortex-M3\u5e73\u53f0\u3002\n<\/p>\n<h4>\n 1.6 \u7528\u6237\u4ea4\u4e92\u6309\u952e\u4e0e\u62a5\u8b66\u4f7f\u80fd\u63a7\u5236<br \/>\n<\/h4>\n<p>\n \u7cfb\u7edf\u9884\u7559\u4e00\u4e2a\u7269\u7406\u6309\u952e&#xff08;\u5047\u8bbe\u8fde\u63a5\u81f3PB0&#xff09;&#xff0c;\u7528\u4e8e\u624b\u52a8\u542f\u505c\u62a5\u8b66\u529f\u80fd\u3002\u8be5\u6309\u952e\u9700\u5b9e\u73b0\u786c\u4ef6\u6d88\u6296\u4e0e\u72b6\u6001\u673a\u7ba1\u7406&#xff0c;\u907f\u514d\u673a\u68b0\u6296\u52a8\u5f15\u53d1\u591a\u6b21\u89e6\u53d1\u3002\n<\/p>\n<h5>\n 1.6.1 \u6309\u952e\u72b6\u6001\u673a\u8bbe\u8ba1<br \/>\n<\/h5>\n<p>\n \u5b9a\u4e49\u4e09\u79cd\u7a33\u5b9a\u72b6\u6001&#xff1a;<\/p>\n<p> &#8211;<\/p>\n<p>  KEY_IDLE<\/p>\n<p> &#xff1a;\u6309\u952e\u672a\u6309\u4e0b&#xff0c;\u7535\u5e73\u4e3a\u9ad8&#xff08;\u4e0a\u62c9&#xff09;<\/p>\n<p> &#8211;<\/p>\n<p>  KEY_PRESSED<\/p>\n<p> &#xff1a;\u68c0\u6d4b\u5230\u4e0b\u964d\u6cbf&#xff0c;\u8fdb\u5165\u6d88\u6296\u8ba1\u65f6<\/p>\n<p> &#8211;<\/p>\n<p>  KEY_RELEASED<\/p>\n<p> &#xff1a;\u68c0\u6d4b\u5230\u4e0a\u5347\u6cbf&#xff0c;\u786e\u8ba4\u91ca\u653e\n<\/p>\n<p>\n \u5728<\/p>\n<p>  main.c<\/p>\n<p> \u4e2d\u6dfb\u52a0&#xff1a;\n<\/p>\n<p>typedef enum {<br \/>\n    KEY_IDLE,<br \/>\n    KEY_PRESSED,<br \/>\n    KEY_RELEASED<br \/>\n} KeyState_t;<\/p>\n<p>static KeyState_t key_state &#061; KEY_IDLE;<br \/>\nstatic uint32_t key_press_time &#061; 0;<\/p>\n<p>void check_key_state(void)<br \/>\n{<br \/>\n    static uint32_t last_tick &#061; 0;<br \/>\n    uint32_t current_tick &#061; HAL_GetTick();<\/p>\n<p>    \/\/ \u6bcf10ms\u626b\u63cf\u4e00\u6b21<br \/>\n    if (current_tick &#8211; last_tick &lt; 10) return;<br \/>\n    last_tick &#061; current_tick;<\/p>\n<p>    switch (key_state)<br \/>\n    {<br \/>\n        case KEY_IDLE:<br \/>\n            if (HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0) &#061;&#061; GPIO_PIN_RESET) \/\/ \u6309\u4e0b<br \/>\n            {<br \/>\n                key_state &#061; KEY_PRESSED;<br \/>\n                key_press_time &#061; current_tick;<br \/>\n            }<br \/>\n            break;<\/p>\n<p>        case KEY_PRESSED:<br \/>\n            if (HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0) &#061;&#061; GPIO_PIN_SET) \/\/ \u91ca\u653e<br \/>\n            {<br \/>\n                if (current_tick &#8211; key_press_time &gt; 20) \/\/ \u6d88\u629620ms<br \/>\n                {<br \/>\n                    key_state &#061; KEY_RELEASED;<br \/>\n                    \/\/ \u6267\u884c\u62a5\u8b66\u4f7f\u80fd\u5207\u6362<br \/>\n                    alarm_flag &#061; !alarm_flag;<br \/>\n                    \/\/ \u540c\u6b65\u66f4\u65b0\u7ea2\u706f&#xff1a;alarm_flag\u4e3a1\u65f6\u7ea2\u706f\u5e38\u4eae&#xff0c;\u4e3a0\u65f6\u706d<br \/>\n                    if (alarm_flag) LED_RED_ON();<br \/>\n                    else LED_RED_OFF();<br \/>\n                }<br \/>\n            }<br \/>\n            else if (current_tick &#8211; key_press_time &gt; 1000) \/\/ \u957f\u63091\u79d2\u8fdb\u5165\u914d\u7f6e\u6a21\u5f0f&#xff08;\u9884\u7559&#xff09;<br \/>\n            {<br \/>\n                key_state &#061; KEY_IDLE;<br \/>\n            }<br \/>\n            break;<\/p>\n<p>        case KEY_RELEASED:<br \/>\n            if (HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0) &#061;&#061; GPIO_PIN_SET)<br \/>\n            {<br \/>\n                key_state &#061; KEY_IDLE;<br \/>\n            }<br \/>\n            break;<br \/>\n    }<br \/>\n}<\/p>\n<p>\n \u6b64\u72b6\u6001\u673a\u786e\u4fdd&#xff1a;<\/p>\n<p> &#8211; \u5355\u6b21\u6309\u952e\u4ec5\u89e6\u53d1\u4e00\u6b21<\/p>\n<p>  alarm_flag<\/p>\n<p> \u7ffb\u8f6c&#xff1b;<\/p>\n<p> &#8211; 20ms\u786c\u4ef6\u6d88\u6296\u65f6\u95f4\u8986\u76d6\u7edd\u5927\u591a\u6570\u6309\u952e\u89c4\u683c&#xff1b;<\/p>\n<p> &#8211; \u957f\u6309\u68c0\u6d4b\u4e3a\u540e\u7eed\u529f\u80fd&#xff08;\u5982\u9608\u503c\u91cd\u8bbe&#xff09;\u9884\u7559\u63a5\u53e3\u3002\n<\/p>\n<h5>\n 1.6.2 \u4e3b\u5faa\u73af\u96c6\u6210\u4e0e\u6267\u884c\u65f6\u5e8f<br \/>\n<\/h5>\n<p>\n \u6700\u7ec8<\/p>\n<p>  main()<\/p>\n<p> \u51fd\u6570\u4e3b\u5faa\u73af\u7ed3\u6784\u5982\u4e0b&#xff1a;\n<\/p>\n<p>int main(void)<br \/>\n{<br \/>\n    HAL_Init();<br \/>\n    SystemClock_Config();<br \/>\n    MX_GPIO_Init();<br \/>\n    MX_TIM3_Init();<br \/>\n    MX_USART1_UART_Init(); \/\/ \u7528\u4e8e\u8c03\u8bd5\u8f93\u51fa<br \/>\n    MX_I2C1_Init();        \/\/ \u7528\u4e8e\u5149\u7167\u4f20\u611f\u5668<br \/>\n    \/\/ &#8230; \u5176\u4ed6\u5916\u8bbe\u521d\u59cb\u5316<\/p>\n<p>    \/\/ \u542f\u52a8TIM3<br \/>\n    HAL_TIM_Base_Start_IT(&amp;htim3);<\/p>\n<p>    uint32_t last_sensor_read &#061; 0;<\/p>\n<p>    while (1)<br \/>\n    {<br \/>\n        \/\/ \u6bcf500ms\u8bfb\u53d6\u4e00\u6b21\u4f20\u611f\u5668<br \/>\n        if (HAL_GetTick() &#8211; last_sensor_read &gt;&#061; 500)<br \/>\n        {<br \/>\n            read_all_sensors();           \/\/ \u8bfb\u53d6\u539f\u59cb\u503c<br \/>\n            update_sensor_filters(temp_raw, humi_raw, light_raw); \/\/ \u6ee4\u6ce2<br \/>\n            last_sensor_read &#061; HAL_GetTick();<br \/>\n        }<\/p>\n<p>        \/\/ \u6bcf10ms\u68c0\u6d4b\u6309\u952e<br \/>\n        check_key_state();<\/p>\n<p>        \/\/ \u6bcf100ms\u6253\u5370\u8c03\u8bd5\u4fe1\u606f&#xff08;\u53ef\u9009&#xff09;<br \/>\n        if (HAL_GetTick() % 100 &#061;&#061; 0)<br \/>\n        {<br \/>\n            printf(&#034;T:%d H:%d L:%lu ALARM:%d\\\\r\\\\n&#034;,<br \/>\n                   get_filtered_temp(), get_filtered_humi(),<br \/>\n                   get_filtered_light(), alarm_flag);<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\n \u65f6\u5e8f\u8bbe\u8ba1\u8981\u70b9&#xff1a;<\/p>\n<p> &#8211; \u4f20\u611f\u5668\u91c7\u6837\u5468\u671f&#xff08;500ms&#xff09;\u8fdc\u5927\u4e8e\u5355\u6b21\u8bfb\u53d6\u8017\u65f6&#xff08;&lt;10ms&#xff09;&#xff0c;\u907f\u514d\u603b\u7ebf\u963b\u585e&#xff1b;<\/p>\n<p> &#8211; \u6309\u952e\u626b\u63cf&#xff08;10ms&#xff09;\u4e0e\u62a5\u8b66\u903b\u8f91\u89e3\u8026&#xff0c;\u786e\u4fdd\u54cd\u5e94\u7075\u654f&#xff1b;<\/p>\n<p> &#8211; \u8c03\u8bd5\u8f93\u51fa\u5f02\u6b65\u8fdb\u884c&#xff0c;\u4e0d\u5f71\u54cd\u5b9e\u65f6\u6027\u3002\n<\/p>\n<h4>\n 1.7 \u7cfb\u7edf\u8054\u8c03\u4e0e\u5e38\u89c1\u95ee\u9898\u6392\u67e5<br \/>\n<\/h4>\n<p>\n \u5b8c\u6210\u7f16\u7801\u540e&#xff0c;\u9700\u8fdb\u884c\u5206\u5c42\u9a8c\u8bc1&#xff1a;\n<\/p>\n<h5>\n 1.7.1 \u786c\u4ef6\u5c42\u9a8c\u8bc1<br \/>\n<\/h5>\n<ul>\n<li>\n  \u4f7f\u7528\u4e07\u7528\u8868\u6d4b\u91cfPA0\u5f15\u811a&#xff1a;\u5728<\/p>\n<p>   alarm_flag&#061;1<\/p>\n<p>  \u65f6\u5e94\u4e3a3.3V&#xff0c;<\/p>\n<p>   alarm_flag&#061;0<\/p>\n<p>  \u65f6\u4e3a0V&#xff1b;\n <\/li>\n<li>\n  \u7528\u793a\u6ce2\u5668\u89c2\u6d4bPA0\u6ce2\u5f62&#xff1a;\u5e94\u4e3a\u6e05\u6670299Hz\u65b9\u6ce2&#xff0c;\u5360\u7a7a\u6bd450%&#xff0c;\u65e0\u6bdb\u523a&#xff1b;\n <\/li>\n<li>\n  \u624b\u52a8\u77ed\u63a5PB0\u81f3GND&#xff1a;\u89c2\u5bdf\u7ea2\u706f\u662f\u5426\u6309\u9884\u671f\u5207\u6362\u72b6\u6001\u3002\n <\/li>\n<\/ul>\n<h5>\n 1.7.2 \u8f6f\u4ef6\u903b\u8f91\u9a8c\u8bc1<br \/>\n<\/h5>\n<ul>\n<li>\n  \u5f3a\u5236\u8bbe\u7f6e<\/p>\n<p>   temp&#061;35<\/p>\n<p>  \u3001<\/p>\n<p>   humi&#061;75<\/p>\n<p>  \u3001<\/p>\n<p>   light&#061;5000<\/p>\n<p>  \u2192<\/p>\n<p>   alarm_flag<\/p>\n<p>  \u5e94\u4e3a1&#xff1b;\n <\/li>\n<li>\n  \u5f3a\u5236\u8bbe\u7f6e<\/p>\n<p>   temp&#061;25<\/p>\n<p>  \u3001<\/p>\n<p>   humi&#061;75<\/p>\n<p>  \u3001<\/p>\n<p>   light&#061;5000<\/p>\n<p>  \u2192<\/p>\n<p>   alarm_flag<\/p>\n<p>  \u5e94\u4e3a0&#xff1b;\n <\/li>\n<li>\n  \u4fee\u6539\u9608\u503c\u4e3a<\/p>\n<p>   temp&gt;100<\/p>\n<p>  &#xff0c;\u786e\u8ba4\u6c38\u4e0d\u89e6\u53d1&#xff08;\u9a8c\u8bc1\u903b\u8f91\u5b8c\u6574\u6027&#xff09;\u3002\n <\/li>\n<\/ul>\n<h5>\n 1.7.3 \u5178\u578b\u6545\u969c\u73b0\u8c61\u4e0e\u6839\u56e0<br \/>\n<\/h5>\n<table>\n<tr>\n    \u73b0\u8c61<\/p>\n<p>    \u53ef\u80fd\u539f\u56e0<\/p>\n<p>    \u89e3\u51b3\u65b9\u6848<br \/>\n   <\/tr>\n<tbody>\n<tr>\n<td>\n    \u8702\u9e23\u5668\u65e0\u58f0\n   <\/td>\n<td>\n    PA0\u672a\u4f7f\u80fd\u65f6\u949f&#xff1b;GPIO\u6a21\u5f0f\u8bbe\u4e3a\u8f93\u5165&#xff1b;\u4e09\u6781\u7ba1\u635f\u574f\n   <\/td>\n<td>\n    \u68c0\u67e5<\/p>\n<p>     __HAL_RCC_GPIOA_CLK_ENABLE()<\/p>\n<p>    &#xff1b;\u7528\u4e07\u7528\u8868\u6d4bPA0\u7535\u5e73&#xff1b;\u66f4\u6362\u4e09\u6781\u7ba1\n   <\/td>\n<\/tr>\n<tr>\n<td>\n    \u7eff\u706f\u5e38\u4eae\u4e0d\u95ea\u70c1\n   <\/td>\n<td>\n    TIM3\u4e2d\u65ad\u672a\u4f7f\u80fd&#xff1b;<\/p>\n<p>     HAL_TIM_Base_Start_IT()<\/p>\n<p>    \u672a\u8c03\u7528&#xff1b;NVIC\u914d\u7f6e\u9519\u8bef\n   <\/td>\n<td>\n    \u68c0\u67e5<\/p>\n<p>     HAL_NVIC_EnableIRQ(TIM3_IRQn)<\/p>\n<p>    &#xff1b;\u786e\u8ba4<\/p>\n<p>     MX_TIM3_Init()<\/p>\n<p>    \u88ab\u8c03\u7528&#xff1b;\u7528\u8c03\u8bd5\u5668\u67e5\u770b<\/p>\n<p>     NVIC-&gt;ISER<\/p>\n<p>    \u5bc4\u5b58\u5668\n   <\/td>\n<\/tr>\n<tr>\n<td>\n    \u62a5\u8b66\u903b\u8f91\u4e0d\u751f\u6548\n   <\/td>\n<td>\n<p>     alarm_flag<\/p>\n<p>    \u53d8\u91cf\u672a\u58f0\u660e\u4e3a<\/p>\n<p>     extern<\/p>\n<p>    &#xff1b;\u4e3b\u5faa\u73af\u672a\u8c03\u7528<\/p>\n<p>     check_alarm_conditions()<\/p>\n<p>    &#xff1b;\u4f20\u611f\u5668\u8bfb\u6570\u5168\u4e3a0\n   <\/td>\n<td>\n    \u68c0\u67e5\u53d8\u91cf\u4f5c\u7528\u57df&#xff1b;\u786e\u8ba4\u51fd\u6570\u8c03\u7528\u8def\u5f84&#xff1b;\u5728<\/p>\n<p>     printf<\/p>\n<p>    \u4e2d\u6253\u5370\u539f\u59cb\u4f20\u611f\u5668\u503c\u5b9a\u4f4d\u8bfb\u53d6\u5931\u8d25\u70b9\n   <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\n \u6211\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u66fe\u9047\u5230TIM3\u4e2d\u65ad\u4f18\u5148\u7ea7\u8bbe\u4e3a0\u5bfc\u81f4\u4e32\u53e3\u63a5\u6536\u4e22\u5e27\u7684\u95ee\u9898\u2014\u2014\u5f53\u65f6\u5c06\u6240\u6709\u4e2d\u65ad\u7edf\u4e00\u8bbe\u4e3a\u6700\u9ad8\u4f18\u5148\u7ea7&#xff0c;\u7ed3\u679cSysTick\u62a2\u5360\u4e32\u53e3\u4e2d\u65ad\u9020\u6210DMA\u7f13\u51b2\u533a\u6ea2\u51fa\u3002\u540e\u6765\u4e25\u683c\u6309\u201c\u901a\u4fe1&gt;\u5b9a\u65f6&gt;GPIO\u201d\u5206\u7ea7&#xff0c;\u95ee\u9898\u5f7b\u5e95\u89e3\u51b3\u3002\u8fd9\u4e2a\u6559\u8bad\u63d0\u9192\u6211\u4eec&#xff1a;\u5b9e\u65f6\u6027\u4e0d\u7b49\u4e8e\u4e00\u5473\u63d0\u9ad8\u4f18\u5148\u7ea7&#xff0c;\u800c\u662f\u7cbe\u51c6\u5339\u914d\u4efb\u52a1\u65f6\u6548\u9700\u6c42\u3002\n<\/p>\n<p>\n \u81f3\u6b64&#xff0c;\u4e00\u5957\u5b8c\u6574\u7684\u3001\u53ef\u5de5\u7a0b\u843d\u5730\u7684\u8702\u9e23\u5668\u4e0eLED\u534f\u540c\u62a5\u8b66\u7cfb\u7edf\u5df2\u6784\u5efa\u5b8c\u6bd5\u3002\u6240\u6709\u4ee3\u7801\u5747\u53ef\u76f4\u63a5\u7f16\u8bd1\u8fd0\u884c&#xff0c;\u65e0\u9700\u989d\u5916\u4f9d\u8d56\u3002\u4e0b\u4e00\u6b65\u53ef\u5728\u6b64\u57fa\u7840\u4e0a\u6269\u5c55&#xff1a;\u901a\u8fc7USART\u5c06\u62a5\u8b66\u4e8b\u4ef6\u4e0a\u62a5\u81f3\u624b\u673a\u5c0f\u7a0b\u5e8f&#xff0c;\u6216\u589e\u52a0EEPROM\u5b58\u50a8\u5386\u53f2\u62a5\u8b66\u8bb0\u5f55\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u8702\u9e23\u5668\u4e0eLED\u62a5\u8b66\u7cfb\u7edf\u5de5\u7a0b\u5b9e\u73b0\u5728\u667a\u80fd\u5bb6\u5c45\u7ec8\u7aef\u8bbe\u5907\u4e2d&#xff0c;\u58f0\u5149\u62a5\u8b66\u662f\u73af\u5883\u5f02\u5e38\u72b6\u6001\u6700\u76f4\u63a5\u3001\u6700\u53ef\u9760\u7684\u672c\u5730\u5316\u53cd\u9988\u673a\u5236\u3002\u672c\u8282\u5c06\u57fa\u4e8eSTM32F103C8T6\u6700\u5c0f\u7cfb\u7edf&#xff0c;\u7ed3\u5408\u539f\u7406\u56fe\u786c\u4ef6\u8bbe\u8ba1&#xff0c;\u5b8c\u6210\u8702\u9e23\u5668\u9a71\u52a8\u3001\u53cc\u8272LED\u72b6\u6001\u6307\u793a\u3001\u591a\u6761\u4ef6\u590d\u5408\u62a5\u8b66\u903b\u8f91\u53ca\u5b9a\u65f6\u5668\u9a71\u52a8\u7684PWM\u5f0f\u62a5\u8b66\u63a7\u5236\u3002\u6574\u4e2a\u5b9e\u73b0\u4e0d\u4f9d\u8d56\u4efb\u4f55\u7b2c\u4e09\u65b9GUI\u5e93\u6216\u4e0a\u5c42\u6846\u67b6&#xff0c;\u5168\u90e8\u91c7\u7528HAL\u5e93\u5e95\u5c42API\u6784\u5efa&#xff0c;\u786e\u4fdd\u4ee3\u7801\u53ef\u79fb\u690d\u6027\u4e0e\u5de5\u7a0b\u53ef\u63a7\u6027\u30021.1 \u786c\u4ef6\u8fde\u63a5\u4e0e\u5f15\u811a\u786e\u8ba4\u6839\u636e\u539f\u7406\u56fe\u6807\u6ce8<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8017,8016,217],"topic":[],"class_list":["post-75383","post","type-post","status-publish","format-standard","hentry","category-server","tag-led","tag-8016","tag-stm32"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/75383.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u8702\u9e23\u5668\u4e0eLED\u62a5\u8b66\u7cfb\u7edf\u5de5\u7a0b\u5b9e\u73b0\u5728\u667a\u80fd\u5bb6\u5c45\u7ec8\u7aef\u8bbe\u5907\u4e2d&#xff0c;\u58f0\u5149\u62a5\u8b66\u662f\u73af\u5883\u5f02\u5e38\u72b6\u6001\u6700\u76f4\u63a5\u3001\u6700\u53ef\u9760\u7684\u672c\u5730\u5316\u53cd\u9988\u673a\u5236\u3002\u672c\u8282\u5c06\u57fa\u4e8eSTM32F103C8T6\u6700\u5c0f\u7cfb\u7edf&#xff0c;\u7ed3\u5408\u539f\u7406\u56fe\u786c\u4ef6\u8bbe\u8ba1&#xff0c;\u5b8c\u6210\u8702\u9e23\u5668\u9a71\u52a8\u3001\u53cc\u8272LED\u72b6\u6001\u6307\u793a\u3001\u591a\u6761\u4ef6\u590d\u5408\u62a5\u8b66\u903b\u8f91\u53ca\u5b9a\u65f6\u5668\u9a71\u52a8\u7684PWM\u5f0f\u62a5\u8b66\u63a7\u5236\u3002\u6574\u4e2a\u5b9e\u73b0\u4e0d\u4f9d\u8d56\u4efb\u4f55\u7b2c\u4e09\u65b9GUI\u5e93\u6216\u4e0a\u5c42\u6846\u67b6&#xff0c;\u5168\u90e8\u91c7\u7528HAL\u5e93\u5e95\u5c42API\u6784\u5efa&#xff0c;\u786e\u4fdd\u4ee3\u7801\u53ef\u79fb\u690d\u6027\u4e0e\u5de5\u7a0b\u53ef\u63a7\u6027\u30021.1 \u786c\u4ef6\u8fde\u63a5\u4e0e\u5f15\u811a\u786e\u8ba4\u6839\u636e\u539f\u7406\u56fe\u6807\u6ce8\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/75383.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-12T00:06:39+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75383.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/75383.html\",\"name\":\"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-12T00:06:39+00:00\",\"dateModified\":\"2026-02-12T00:06:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/75383.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/75383.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/75383.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/75383.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u8702\u9e23\u5668\u4e0eLED\u62a5\u8b66\u7cfb\u7edf\u5de5\u7a0b\u5b9e\u73b0\u5728\u667a\u80fd\u5bb6\u5c45\u7ec8\u7aef\u8bbe\u5907\u4e2d&#xff0c;\u58f0\u5149\u62a5\u8b66\u662f\u73af\u5883\u5f02\u5e38\u72b6\u6001\u6700\u76f4\u63a5\u3001\u6700\u53ef\u9760\u7684\u672c\u5730\u5316\u53cd\u9988\u673a\u5236\u3002\u672c\u8282\u5c06\u57fa\u4e8eSTM32F103C8T6\u6700\u5c0f\u7cfb\u7edf&#xff0c;\u7ed3\u5408\u539f\u7406\u56fe\u786c\u4ef6\u8bbe\u8ba1&#xff0c;\u5b8c\u6210\u8702\u9e23\u5668\u9a71\u52a8\u3001\u53cc\u8272LED\u72b6\u6001\u6307\u793a\u3001\u591a\u6761\u4ef6\u590d\u5408\u62a5\u8b66\u903b\u8f91\u53ca\u5b9a\u65f6\u5668\u9a71\u52a8\u7684PWM\u5f0f\u62a5\u8b66\u63a7\u5236\u3002\u6574\u4e2a\u5b9e\u73b0\u4e0d\u4f9d\u8d56\u4efb\u4f55\u7b2c\u4e09\u65b9GUI\u5e93\u6216\u4e0a\u5c42\u6846\u67b6&#xff0c;\u5168\u90e8\u91c7\u7528HAL\u5e93\u5e95\u5c42API\u6784\u5efa&#xff0c;\u786e\u4fdd\u4ee3\u7801\u53ef\u79fb\u690d\u6027\u4e0e\u5de5\u7a0b\u53ef\u63a7\u6027\u30021.1 \u786c\u4ef6\u8fde\u63a5\u4e0e\u5f15\u811a\u786e\u8ba4\u6839\u636e\u539f\u7406\u56fe\u6807\u6ce8","og_url":"https:\/\/www.wsisp.com\/helps\/75383.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-12T00:06:39+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/75383.html","url":"https:\/\/www.wsisp.com\/helps\/75383.html","name":"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-12T00:06:39+00:00","dateModified":"2026-02-12T00:06:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/75383.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/75383.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/75383.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32\u8702\u9e23\u5668\u4e0eLED\u58f0\u5149\u62a5\u8b66\u7cfb\u7edf\u5b9e\u73b0"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=75383"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/75383\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=75383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=75383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=75383"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=75383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}