{"id":3534,"date":"2025-04-09T22:00:49","date_gmt":"2025-04-09T14:00:49","guid":{"rendered":"https:\/\/saludpcb.com\/zh\/?p=3534"},"modified":"2025-09-26T06:15:46","modified_gmt":"2025-09-25T22:15:46","slug":"breathing-led-smooth-fade-effect-tutorial","status":"publish","type":"post","link":"https:\/\/saludpcb.com\/zh\/breathing-led-smooth-fade-effect-tutorial\/","title":{"rendered":"\u7cbe\u901a ESP32 \u547c\u5438\u71c8 Breathing \u8a2d\u8a08\uff5c\u6f38\u4eae\u6f38\u6697\u7684 LEDC PWM \u6548\u679c\u6559\u5b78"},"content":{"rendered":"\n<hr class=\"wp-block-separator alignwide has-text-color has-palette-color-1-color has-alpha-channel-opacity has-palette-color-1-background-color has-background is-style-wide\"\/>\n\n\n\n<p>\u5728\u7269\u806f\u7db2\u88dd\u7f6e\u8a2d\u8a08\u4e2d\uff0c\u6f38\u4eae\u6f38\u6697\u7684 LED \u547c\u5438\u71c8\uff08Breathing Light\uff09\u6548\u679c\u4e0d\u50c5\u5e38\u898b\uff0c\u9084\u80fd\u70ba\u88dd\u7f6e\u589e\u6dfb\u751f\u547d\u611f\u3002\u7121\u8ad6\u662f\u5f85\u6a5f\u986f\u793a\u3001\u7761\u7720\u6a21\u5f0f\u63d0\u793a\uff0c\u9084\u662f\u6c1b\u570d\u71c8\u8a2d\u8a08\uff0c\u547c\u5438\u71c8\u90fd\u662f\u4e00\u500b\u5be6\u7528\u53c8\u7f8e\u89c0\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u6211\u5c07\u5e36\u4f60\u5f9e\u96f6\u958b\u59cb\uff0c\u6df1\u5165\u638c\u63e1\u5982\u4f55\u4f7f\u7528 ESP32 \u8207&nbsp;<strong>LEDC<\/strong>&nbsp;\u548c PWM \u5be6\u73fe\u547c\u5438\u71c8\u6548\u679c\uff0c\u4e26\u4f7f\u7528 ESP-IDF \u958b\u767c\u74b0\u5883\uff0c\u5b8c\u6574\u793a\u7bc4\u5982\u4f55\u63a7\u5236 LED \u6f38\u4eae\u6f38\u6697\uff0c\u9054\u5230\u8996\u89ba\u4e0a\u5e73\u6ed1\u4e14\u7a69\u5b9a\u7684\u547c\u5438\u611f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/saludpcb.com\/zh\/wp-content\/uploads\/2025\/04\/Create-a-Breathing-LED-with-ESP32-Smooth-Fade-Effect-Tutorial.jpg\" alt=\"Breathing\" class=\"wp-image-3535\" title=\"\" srcset=\"https:\/\/saludpcb.com\/zh\/wp-content\/uploads\/2025\/04\/Create-a-Breathing-LED-with-ESP32-Smooth-Fade-Effect-Tutorial.jpg 1024w, https:\/\/saludpcb.com\/zh\/wp-content\/uploads\/2025\/04\/Create-a-Breathing-LED-with-ESP32-Smooth-Fade-Effect-Tutorial-768x768.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>\u5167\u5bb9<\/h2><nav><ul><li class=\"\"><a href=\"#\u4ec0\u9ebc\u662f-modbus\uff1f\">\u4ec0\u9ebc\u662f\u300c\u547c\u5438\u71c8\u300d\uff1f<\/a><\/li><li class=\"\"><a href=\"#pwm-\u8207\u547c\u5438\u71c8\u539f\u7406\u5feb\u901f\u7406\u89e3\">PWM \u8207\u547c\u5438\u71c8\u539f\u7406\u5feb\u901f\u7406\u89e3<\/a><\/li><li class=\"\"><a href=\"#\u74b0\">\u958b\u767c\u74b0\u5883<\/a><\/li><li class=\"\"><a href=\"#\u4f7f\u7528-esp-idf-\u64b0\u5beb\u547c\u5438\u71c8\u63a7\u5236\u7a0b\u5f0f\">\u4f7f\u7528 ESP-IDF \u64b0\u5beb\u547c\u5438\u71c8\u63a7\u5236\u7a0b\u5f0f<\/a><\/li><li class=\"\"><a href=\"#\u7de8\u8b6f\u548c\u71d2\u9304\">\u547c\u5438\u6548\u679c\u63a7\u5236\u6280\u5de7<\/a><\/li><li class=\"\"><a href=\"#\u7de8\u8b6f\u548c\u71d2\u9304-1\">\u7de8\u8b6f\u548c\u71d2\u9304<\/a><\/li><li class=\"\"><a href=\"#\u7d50\u8ad6\">\u7d50\u8ad6<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4ec0\u9ebc\u662f-modbus\uff1f\">\u4ec0\u9ebc\u662f\u300c\u547c\u5438\u71c8\u300d\uff1f<\/h2>\n\n\n\n<p>\u547c\u5438\u71c8\uff08Breathing Light\uff09\u662f\u4e00\u7a2e&nbsp;<strong>LED \u4eae\u5ea6\u96a8\u6642\u9593\u7de9\u6162\u8b8a\u5316\u3001\u770b\u8d77\u4f86\u50cf\u300c\u547c\u5438\u300d\u4e00\u6a23\u7684\u71c8\u5149\u6548\u679c<\/strong>\u3002\u5b83\u4e0d\u50cf\u4e00\u822c\u9583\u720d\u90a3\u6a23\u7a81\u5140\uff0c\u800c\u662f&nbsp;<strong>\u6f38\u4eae\u2192\u6f38\u6697\u2192\u91cd\u8907\u5faa\u74b0<\/strong>\uff0c\u7522\u751f\u5e73\u6ed1\u800c\u5177\u6709\u7bc0\u594f\u611f\u7684\u8996\u89ba\u9ad4\u9a57\u3002<\/p>\n\n\n\n<p>\u9019\u7a2e\u71c8\u5149\u6548\u679c\u7d93\u5e38\u61c9\u7528\u5728\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u88dd\u7f6e\u5f85\u6a5f\u72c0\u614b\u986f\u793a<\/strong>\uff08\u5982\u7b46\u96fb\u96fb\u6e90\u71c8\uff09<\/li>\n\n\n\n<li><strong>\u7761\u7720\u8f14\u52a9\u71c8\u3001\u591c\u71c8<\/strong><\/li>\n\n\n\n<li><strong>\u667a\u6167\u5bb6\u5c45\u6c1b\u570d\u7167\u660e<\/strong><\/li>\n\n\n\n<li><strong>\u8996\u89ba UI \u56de\u994b\u6548\u679c\uff08UX\uff09<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u547c\u5438\u71c8\u4e0d\u53ea\u80fd\u8b93\u88dd\u7f6e\u770b\u8d77\u4f86\u66f4\u6709\u751f\u547d\u611f\uff0c\u4e5f\u80fd\u63d0\u4f9b\u4f7f\u7528\u8005\u66f4\u6eab\u548c\u7684\u8996\u89ba\u63d0\u793a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pwm-\u8207\u547c\u5438\u71c8\u539f\u7406\u5feb\u901f\u7406\u89e3\">PWM \u8207\u547c\u5438\u71c8\u539f\u7406\u5feb\u901f\u7406\u89e3<\/h2>\n\n\n\n<p>\u547c\u5438\u71c8\u7684\u6838\u5fc3\u539f\u7406\uff0c\u662f\u900f\u904e&nbsp;<strong>PWM<\/strong>&nbsp;\u6280\u8853\u6539\u8b8a LED \u7684\u4eae\u5ea6\u3002<\/p>\n\n\n\n<p><strong>PWM<\/strong>&nbsp;\u662f\u4e00\u7a2e\u8b93\u6578\u4f4d\u8173\u4f4d\u300c\u770b\u8d77\u4f86\u50cf\u985e\u6bd4\u8f38\u51fa\u300d\u7684\u65b9\u5f0f\uff0c\u63a7\u5236\u7684\u662f\u6bcf\u500b\u9031\u671f\u4e2d\u9ad8\u96fb\u4f4d\u7684\u6642\u9593\u4f54\u6bd4\uff08\u5373\u4f54\u7a7a\u6bd4\uff09\u3002\u7576\u6211\u5011\u8b93\u4f54\u7a7a\u6bd4\u5728 0%\uff5e100% \u9593\u5e73\u6ed1\u8b8a\u5316\u6642\uff0cLED \u7684\u4eae\u5ea6\u4e5f\u6703\u96a8\u4e4b\u9010\u6f38\u8b8a\u5316\uff0c\u7522\u751f\u547c\u5438\u71c8\u6548\u679c\u3002<\/p>\n\n\n\n<p>ESP32 \u7684&nbsp;<strong>LEDC<\/strong>\uff08LED Control\uff09\u6a21\u7d44\u652f\u63f4\u9ad8\u89e3\u6790\u5ea6\u7684 PWM \u8f38\u51fa\uff0c\u6700\u591a\u652f\u63f4 16 \u500b\u901a\u9053\uff0c\u80fd\u540c\u6642\u63a7\u5236\u591a\u9846 LED \u6216\u99ac\u9054\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u74b0\">\u958b\u767c\u74b0\u5883<\/h2>\n\n\n\n<p>\u5728\u958b\u59cb\u7de8\u7a0b\u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u5df2\u5b8c\u6210\u4ee5\u4e0b\u6e96\u5099\u5de5\u4f5c\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/saludpcb.com\/zh\/esp32-tutorial-how-to-create-an-esp32-project-with-vscode\/\">\u5b89\u88dd ESP-IDF \u958b\u767c\u74b0\u5883<\/a> (\u81f3\u5c11\u7248\u672c v4.4 \u6216\u66f4\u9ad8)\u3002<\/li>\n\n\n\n<li><a href=\"https:\/\/saludpcb.com\/zh\/esp32-devkit-module-pinout\/\">ESP32 \u958b\u767c\u677f<\/a>\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4f7f\u7528-esp-idf-\u64b0\u5beb\u547c\u5438\u71c8\u63a7\u5236\u7a0b\u5f0f\">\u4f7f\u7528 ESP-IDF \u64b0\u5beb\u547c\u5438\u71c8\u63a7\u5236\u7a0b\u5f0f<\/h2>\n\n\n\n<p>\u5efa\u7acb\u4e00\u500b ESP-IDF \u5c08\u6848\uff0c\u4e26\u5c07\u4e0b\u5217\u7a0b\u5f0f\u78bc\u653e\u5165&nbsp;<code>main\/main.c<\/code>&nbsp;\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp\">\/**\n * ESP32 Breathing LED Example using ESP-IDF\n * This code demonstrates a smooth breathing effect on an LED using PWM hardware fading\n *\/\n\n#include &lt;stdio.h&gt;\n#include \"freertos\/FreeRTOS.h\"\n#include \"freertos\/task.h\"\n#include \"driver\/ledc.h\"        \/\/ LED Control (PWM) driver\n#include \"esp_err.h\"           \/\/ ESP32 error codes\n\n\/* Hardware Configuration *\/\n#define LED_GPIO        GPIO_NUM_2     \/\/ GPIO pin connected to LED (adjust according to your setup)\n#define LEDC_CHANNEL    LEDC_CHANNEL_0 \/\/ PWM channel (ESP32 has 0-7 high-speed channels)\n#define LEDC_TIMER      LEDC_TIMER_0   \/\/ PWM timer (ESP32 has 0-3 timers)\n#define LEDC_MODE       LEDC_HIGH_SPEED_MODE  \/\/ PWM operating mode\n#define LEDC_FREQ_HZ    5000           \/\/ PWM frequency in Hz (5kHz works well for LEDs)\n#define LEDC_RES        LEDC_TIMER_13_BIT  \/\/ PWM resolution (13-bit = 0-8191 duty values)\n#define BREATHE_TIME_MS 3000           \/\/ Total time for one complete breathe cycle (in milliseconds)\n\n\/**\n * @brief Main application entry point\n *\/\nvoid app_main(void)\n{\n    \/* Step 1: Configure PWM Timer *\/\n    ledc_timer_config_t ledc_timer = {\n        .speed_mode = LEDC_MODE,       \/\/ PWM mode (high-speed or low-speed)\n        .timer_num = LEDC_TIMER,       \/\/ Timer number (0-3)\n        .duty_resolution = LEDC_RES,   \/\/ PWM resolution (bit depth)\n        .freq_hz = LEDC_FREQ_HZ,      \/\/ PWM frequency\n        .clk_cfg = LEDC_AUTO_CLK       \/\/ Automatic clock source selection\n    };\n    \/\/ Apply timer configuration - this sets up the base PWM signal characteristics\n    ESP_ERROR_CHECK(ledc_timer_config(&amp;ledc_timer));\n\n    \/* Step 2: Configure PWM Channel *\/\n    ledc_channel_config_t ledc_channel = {\n        .gpio_num = LED_GPIO,          \/\/ GPIO pin connected to LED\n        .speed_mode = LEDC_MODE,       \/\/ Must match timer mode\n        .channel = LEDC_CHANNEL,       \/\/ PWM channel (0-7)\n        .intr_type = LEDC_INTR_DISABLE,\/\/ Disable interrupts (not needed for fading)\n        .timer_sel = LEDC_TIMER,       \/\/ Timer to be attached to this channel\n        .duty = 0,                     \/\/ Initial duty cycle (0 = LED off)\n        .hpoint = 0                    \/\/ Phase point (0 for standard PWM)\n    };\n    \/\/ Apply channel configuration - links the timer to a specific GPIO\n    ESP_ERROR_CHECK(ledc_channel_config(&amp;ledc_channel));\n\n    \/* Step 3: Initialize Hardware Fading Functionality *\/\n    \/\/ This enables the ESP32's built-in PWM fading hardware acceleration\n    \/\/ Parameter is interrupt flags (0 means no special interrupt handling)\n    ESP_ERROR_CHECK(ledc_fade_func_install(0));\n\n    \/* Main loop to create breathing effect *\/\n    while (1) {\n        \/* Fade IN (from 0% to 100% brightness) *\/\n        \/\/ Configure fade: target duty = max (8191 for 13-bit), time = half of total cycle\n        ESP_ERROR_CHECK(ledc_set_fade_with_time(LEDC_MODE, LEDC_CHANNEL, \n                            8191, BREATHE_TIME_MS\/2));\n        \/\/ Start fade (LEDC_FADE_NO_WAIT means don't block during fade)\n        ESP_ERROR_CHECK(ledc_fade_start(LEDC_MODE, LEDC_CHANNEL, LEDC_FADE_NO_WAIT));\n        \/\/ Delay for fade duration (while hardware handles the actual fading)\n        vTaskDelay(pdMS_TO_TICKS(BREATHE_TIME_MS\/2));\n\n        \/* Fade OUT (from 100% back to 0% brightness) *\/\n        ESP_ERROR_CHECK(ledc_set_fade_with_time(LEDC_MODE, LEDC_CHANNEL, \n                            0, BREATHE_TIME_MS\/2));\n        ESP_ERROR_CHECK(ledc_fade_start(LEDC_MODE, LEDC_CHANNEL, LEDC_FADE_NO_WAIT));\n        vTaskDelay(pdMS_TO_TICKS(BREATHE_TIME_MS\/2));\n\n        \/* Note: The actual fading happens in hardware while the CPU is free to do other tasks *\/\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7de8\u8b6f\u548c\u71d2\u9304\"><strong>\u547c\u5438\u6548\u679c\u63a7\u5236\u6280\u5de7<\/strong><\/h2>\n\n\n\n<p><strong>Fade IN (\u6f38\u4eae)<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>ledc_set_fade_with_time()<\/code><\/strong>\uff1a\u9019\u500b\u51fd\u6578\u7528\u4f86\u8a2d\u5b9a\u6f38\u8b8a\u7684\u76ee\u6a19\u4f54\u7a7a\u6bd4\u4ee5\u53ca\u6642\u9593\u3002\u5728\u9019\u88e1\uff0c\u76ee\u6a19\u4f54\u7a7a\u6bd4\u662f&nbsp;<strong>8191<\/strong>\uff0c\u9019\u5c0d\u61c9\u65bc 100% \u4eae\u5ea6\uff0813 \u4f4d\u89e3\u6790\u5ea6\uff0c\u7bc4\u570d\u662f 0~8191\uff09\u3002<code>BREATHE_TIME_MS \/ 2<\/code>&nbsp;\u8868\u793a\u6f38\u8b8a\u7684\u6642\u9593\u662f\u7e3d\u9031\u671f\u7684\u4e00\u534a\u3002<\/li>\n\n\n\n<li><strong><code>ledc_fade_start()<\/code><\/strong>\uff1a\u958b\u59cb\u57f7\u884c\u8a2d\u5b9a\u7684\u6f38\u8b8a\uff0c<code>LEDC_FADE_NO_WAIT<\/code>&nbsp;\u8868\u793a\u9019\u500b\u64cd\u4f5c\u4e0d\u6703\u963b\u585e\u7a0b\u5f0f\u57f7\u884c\uff0c\u6703\u8b93\u786c\u9ad4\u81ea\u52d5\u8655\u7406\u6f38\u8b8a\uff0c\u4e26\u4e14\u7a0b\u5f0f\u6703\u7e7c\u7e8c\u57f7\u884c\u5f8c\u7e8c\u4ee3\u78bc\u3002<\/li>\n\n\n\n<li><strong><code>vTaskDelay()<\/code><\/strong>\uff1a\u9019\u500b\u5ef6\u9072\u51fd\u6578\u8b93\u7a0b\u5f0f\u5728\u6f38\u8b8a\u6642\u9593\u5167\u9032\u884c\u5ef6\u9072\uff0c\u4fdd\u8b49\u5728\u6f38\u8b8a\u904e\u7a0b\u4e2d\u4e0d\u6703\u9032\u5165\u4e0b\u4e00\u6b65\u3002\u9019\u88e1\u7684\u5ef6\u9072\u6642\u9593\u662f&nbsp;<code>BREATHE_TIME_MS \/ 2<\/code>\uff0c\u4e5f\u5c31\u662f\u6f38\u8b8a\u6240\u9700\u6642\u9593\u7684\u4e00\u534a\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>Fade OUT (\u6f38\u6697)<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>ledc_set_fade_with_time()<\/code><\/strong>\uff1a\u8207\u6f38\u4eae\u76f8\u4f3c\uff0c\u9019\u88e1\u7684\u76ee\u6a19\u4f54\u7a7a\u6bd4\u8a2d\u70ba&nbsp;<strong>0<\/strong>\uff0c\u8868\u793a\u8981\u5f9e 100% \u4eae\u5ea6\u6f38\u8b8a\u56de 0% \u4eae\u5ea6\uff0c\u6f38\u8b8a\u6642\u9593\u540c\u6a23\u662f\u9031\u671f\u7684\u4e00\u534a\u3002<\/li>\n\n\n\n<li><strong><code>ledc_fade_start()<\/code><\/strong>\uff1a\u958b\u59cb\u6f38\u8b8a\uff0c<code>LEDC_FADE_NO_WAIT<\/code>&nbsp;\u53c3\u6578\u7684\u4f7f\u7528\u65b9\u5f0f\u8207\u524d\u9762\u76f8\u540c\u3002<\/li>\n\n\n\n<li><strong><code>vTaskDelay()<\/code><\/strong>\uff1a\u9019\u88e1\u7684\u5ef6\u9072\u6642\u9593\u540c\u6a23\u662f&nbsp;<code>BREATHE_TIME_MS \/ 2<\/code>\uff0c\u4fdd\u8b49\u6f38\u8b8a\u6642\u9593\u7684\u540c\u6b65\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u95dc\u9375\u6982\u5ff5<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6f38\u8b8a\u6642\u9593<\/strong>\uff08<code>BREATHE_TIME_MS<\/code>\uff09\uff1a\u9019\u500b\u8b8a\u6578\u63a7\u5236\u4e86\u6574\u500b\u547c\u5438\u71c8\u9031\u671f\u7684\u9577\u5ea6\uff0c\u5305\u62ec\u5f9e\u6700\u6697\u5230\u6700\u4eae\u7684\u904e\u6e21\uff0c\u4ee5\u53ca\u5f9e\u6700\u4eae\u5230\u6700\u6697\u7684\u904e\u6e21\u3002\u4f60\u53ef\u4ee5\u6839\u64da\u9700\u6c42\u8abf\u6574\u9019\u500b\u8b8a\u6578\u4f86\u6539\u8b8a\u547c\u5438\u71c8\u7684\u901f\u5ea6\u3002<\/li>\n\n\n\n<li><strong><code>ledc_set_fade_with_time()<\/code><\/strong>\uff1a\u9019\u500b\u51fd\u6578\u6703\u6839\u64da\u8a2d\u5b9a\u7684\u6642\u9593\uff0c\u5728\u6307\u5b9a\u7684\u6642\u9593\u5167\u5b8c\u6210\u6f38\u8b8a\uff0c\u8b93\u4eae\u5ea6\u5e73\u6ed1\u904e\u6e21\u3002<code>BREATHE_TIME_MS \/ 2<\/code>&nbsp;\u7684\u6642\u9593\u8a2d\u5b9a\u78ba\u4fdd\u4e86\u6f38\u8b8a\u7684\u9806\u66a2\u6027\u548c\u6548\u679c\u3002<\/li>\n\n\n\n<li><strong><code>LEDC_FADE_NO_WAIT<\/code><\/strong>\uff1a\u8868\u793a&nbsp;<code>ledc_fade_start()<\/code>&nbsp;\u4e0d\u6703\u7b49\u5f85\u6f38\u8b8a\u5b8c\u6210\uff0c\u800c\u662f\u76f4\u63a5\u8b93\u786c\u9ad4\u8655\u7406\u6f38\u8b8a\u3002\u9019\u6a23\u7a0b\u5f0f\u4e0d\u6703\u88ab\u963b\u585e\uff0c\u53ef\u4ee5\u7e7c\u7e8c\u57f7\u884c\u5176\u4ed6\u7684\u908f\u8f2f\u3002<\/li>\n\n\n\n<li><strong><code>vTaskDelay()<\/code><\/strong>\uff1a\u9019\u500b\u5ef6\u9072\u78ba\u4fdd\u4e86\u7a0b\u5f0f\u5728\u7b49\u5f85\u6f38\u8b8a\u5b8c\u6210\u7684\u540c\u6642\uff0c\u4fdd\u6301\u9069\u7576\u7684\u6642\u9593\u540c\u6b65\uff0c\u4e0d\u6703\u63d0\u524d\u9032\u5165\u4e0b\u4e00\u8f2a\u6f38\u8b8a\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7de8\u8b6f\u548c\u71d2\u9304-1\"><strong>\u7de8\u8b6f\u548c\u71d2\u9304<\/strong><\/h2>\n\n\n\n<p>\u5b8c\u6210\u7a0b\u5f0f\u78bc\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 <a href=\"https:\/\/www.espressif.com\/en\/products\/sdks\/esp-idf\" target=\"_blank\" rel=\"noopener\">ESP-IDF<\/a> \u63d0\u4f9b\u7684\u547d\u4ee4\u9032\u884c\u7de8\u8b6f\u3001\u71d2\u9304\u548c\u76e3\u63a7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7d50\u8ad6\">\u7d50\u8ad6<\/h2>\n\n\n\n<p>\u547c\u5438\u71c8\u770b\u4f3c\u7c21\u55ae\uff0c\u5176\u5be6\u6db5\u84cb\u4e86&nbsp;<strong>PWM \u63a7\u5236\u3001\u6642\u9593\u5ef6\u9072\u3001\u8f38\u51fa\u5e73\u6ed1\u8abf\u8b8a<\/strong>&nbsp;\u7b49\u591a\u500b\u95dc\u9375\u6982\u5ff5\uff0c\u662f\u975e\u5e38\u5be6\u7528\u7684\u5165\u9580\u7bc4\u4f8b\u3002\u7576\u4f60\u80fd\u9748\u6d3b\u904b\u7528\u9019\u4e9b\u57fa\u790e\uff0c\u672a\u4f86\u5728\u99ac\u9054\u63a7\u5236\u3001\u71c8\u5149\u7279\u6548\u6216 UI \u56de\u994b\u8a2d\u8a08\u4e2d\u90fd\u80fd\u6d3e\u4e0a\u7528\u5834\u3002<\/p>\n\n\n\n<p>\u4e0b\u4e00\u7bc7\u6559\u5b78\u6211\u6703\u5e36\u4f60\u505a\u51fa <strong>RGB<\/strong> \u547c\u5438\u71c8 \u6216\u662f \u6839\u64da\u8072\u97f3\u6216\u611f\u6e2c\u5668\u6578\u64da\u52d5\u614b\u8b8a\u5316\u7684\u71c8\u6548\uff0c\u656c\u8acb\u671f\u5f85\uff01<\/p>\n\n\n\n<hr class=\"wp-block-separator alignwide has-text-color has-palette-color-1-color has-alpha-channel-opacity has-palette-color-1-background-color has-background is-style-wide\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7269\u806f\u7db2\u88dd\u7f6e\u8a2d\u8a08\u4e2d\uff0c\u6f38\u4eae\u6f38\u6697\u7684 LED \u547c\u5438\u71c8\uff08Breathing Light\uff09\u6548\u679c\u4e0d\u50c5\u5e38\u898b\uff0c\u9084\u80fd\u70ba\u88dd\u7f6e\u589e\u6dfb\u751f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3535,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,53,83],"tags":[27,21,44,9,11],"class_list":["post-3534","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-module","category-esp32","category-featured","tag-c","tag-ide","tag-programming-language","tag-python","tag-tutorial"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/comments?post=3534"}],"version-history":[{"count":5,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3534\/revisions"}],"predecessor-version":[{"id":3541,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3534\/revisions\/3541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/media\/3535"}],"wp:attachment":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/media?parent=3534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/categories?post=3534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/tags?post=3534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}