{"id":3206,"date":"2024-12-16T15:43:03","date_gmt":"2024-12-16T07:43:03","guid":{"rendered":"https:\/\/saludpcb.com\/zh\/?p=3206"},"modified":"2025-09-26T06:15:58","modified_gmt":"2025-09-25T22:15:58","slug":"key-bounce-stable-button-arduino-esp32-timing","status":"publish","type":"post","link":"https:\/\/saludpcb.com\/zh\/key-bounce-stable-button-arduino-esp32-timing\/","title":{"rendered":"\u5fb9\u5e95\u544a\u5225 Key Bounce | \u4f7f\u7528 Arduino ESP32 Timing \u6253\u9020\u7a69\u5b9a\u6309\u9375\u8f38\u5165"},"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><strong>\u6309\u9375\u5f48\u8df3 (Key Bounce)<\/strong> \u662f\u96fb\u5b50\u9805\u76ee\u4e2d\u5e38\u898b\u7684\u6311\u6230\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528\u6a5f\u68b0\u6309\u9375\u6642\u66f4\u70ba\u7a81\u51fa\u3002\u7531\u65bc\u6309\u9375\u63a5\u89f8\u7684\u4e0d\u7a69\u5b9a\uff0c\u53ef\u80fd\u6703\u7522\u751f\u4e00\u9023\u4e32\u9ad8\u4f4e\u96fb\u5e73\u7684\u4fe1\u865f\u6ce2\u52d5\u3002\u5982\u679c\u672a\u9032\u884c\u9069\u7576\u7684\u6d88\u6296\u8655\u7406\uff0c\u9019\u4e9b\u6ce2\u52d5\u6703\u88ab\u8aa4\u5224\u70ba\u591a\u6b21\u6309\u9375\u89f8\u767c\uff0c\u5c0e\u81f4\u8a2d\u5099\u884c\u70ba\u7570\u5e38\u3002\u7121\u8ad6\u662f DIY \u5c0f\u9805\u76ee\u9084\u662f\u8907\u96dc\u7684\u7269\u806f\u7db2\u8a2d\u5099\uff0c\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\u554f\u984c\u5c0d\u65bc\u7a69\u5b9a\u8f38\u5165\u548c\u53ef\u9760\u904b\u884c\u81f3\u95dc\u91cd\u8981\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\/2024\/12\/Say-Goodbye-to-Key-Bounce-Stable-Button-Inputs-with-Arduino-ESP32-Timing.jpg\" alt=\"Key Bounce\" class=\"wp-image-3212\" title=\"\" srcset=\"https:\/\/saludpcb.com\/zh\/wp-content\/uploads\/2024\/12\/Say-Goodbye-to-Key-Bounce-Stable-Button-Inputs-with-Arduino-ESP32-Timing.jpg 1024w, https:\/\/saludpcb.com\/zh\/wp-content\/uploads\/2024\/12\/Say-Goodbye-to-Key-Bounce-Stable-Button-Inputs-with-Arduino-ESP32-Timing-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=\"#introduction\">\u7c21\u4ecb<\/a><\/li><li class=\"\"><a href=\"#\u4ec0\u9ebc\u662f-touch-sensor\uff1f\">\u4ec0\u9ebc\u662f Key Bounce\uff1f<\/a><\/li><li class=\"\"><a href=\"#\u70ba\u4ec0\u9ebc\u9700\u8981\u4e8b\u4ef6\u9a45\u52d5\u7684-uart\uff1f\">\u5982\u4f55\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\uff1f<\/a><\/li><li class=\"\"><a href=\"#why-use-dma-and-i-2-s-with-adc-on-esp-32\">\u958b\u767c\u74b0\u5883<\/a><\/li><li class=\"\"><a href=\"#1-\u521d\u59cb\u5316-uart-\u914d\u7f6e\">\u4f7f\u7528 Arduino ESP32 Timing \u8655\u7406\u6309\u9375\u5f48\u8df3<\/a><\/li><li class=\"\"><a href=\"#\u7c21\u55ae\u89e3\u91cb\uff1a\">\u7a0b\u5f0f\u78bc\u89e3\u8aaa<\/a><\/li><li class=\"\"><a href=\"#6\">\u8f38\u51fa<\/a><\/li><li class=\"\"><a href=\"#conclusion\">\u7d50\u8ad6<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction\">\u7c21\u4ecb<\/h2>\n\n\n\n<p>\u672c\u6587\u5c07\u4ecb\u7d39\u4f7f\u7528 Arduino \u548c ESP32 \u6709\u6548\u89e3\u6c7a<strong>\u6309\u9375\u5f48\u8df3<\/strong>\u554f\u984c\u3002\u6211\u5011\u5c07\u5229\u7528 ESP32 \u7684\u4e2d\u65b7\u529f\u80fd\u8207\u9ad8\u6548\u7684\u8a08\u6642\u6280\u8853\uff0c\u5be6\u73fe\u7a69\u5b9a\u7684\u6309\u9375\u8f38\u5165\uff0c\u907f\u514d\u963b\u585e\u4e3b\u5faa\u74b0\u7684\u904b\u884c\u3002\u63a5\u4e0b\u4f86\uff0c\u60a8\u5c07\u4e86\u89e3\u4ec0\u9ebc\u662f\u6309\u9375\u5f48\u8df3\uff0c\u70ba\u4ec0\u9ebc\u9700\u8981\u6d88\u6296\uff0c\u4ee5\u53ca\u5982\u4f55\u901a\u904e\u9010\u6b65\u7684\u4ee3\u78bc\u793a\u4f8b\u5be6\u73fe\u4e00\u500b\u7cbe\u78ba\u3001\u53ef\u9760\u7684\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4ec0\u9ebc\u662f-touch-sensor\uff1f\">\u4ec0\u9ebc\u662f <strong>Key Bounce<\/strong>\uff1f<\/h2>\n\n\n\n<p>\u6309\u9375\u5f48\u8df3\u662f\u4e00\u7a2e\u7531\u65bc\u6a5f\u68b0\u63a5\u89f8\u4e0d\u7a69\u5b9a\u800c\u7522\u751f\u7684\u4fe1\u865f\u6ce2\u52d5\u73fe\u8c61\uff0c\u7576\u6309\u4e0b\u6216\u91cb\u653e\u6309\u9375\u6642\uff0c\u96fb\u8def\u4e2d\u53ef\u80fd\u6703\u51fa\u73fe\u4e00\u9023\u4e32\u7684\u9ad8\u4f4e\u96fb\u5e73\u8b8a\u5316\uff08\u898b\u4e0b\u5716\uff09\uff0c\u9019\u4e9b\u6ce2\u52d5\u6703\u88ab\u5fae\u63a7\u5236\u5668\uff08MCU\uff09\u8aa4\u5224\u70ba\u591a\u6b21\u6309\u9375\u89f8\u767c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">\u7406\u60f3\u4fe1\u865f\uff1a  \u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\u5be6\u969b\u4fe1\u865f\uff1a  \u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\u2502\u2502\u2502\u2500\u2518\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\u2502\u2502\u2502\u2500\u2518\u2500\u2500\u2500\u2500\u2500\u2500<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u70ba\u4ec0\u9ebc\u9700\u8981\u4e8b\u4ef6\u9a45\u52d5\u7684-uart\uff1f\">\u5982\u4f55\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\uff1f<\/h2>\n\n\n\n<p><strong><strong>\u6309\u9375\u5f48\u8df3 (Key Bounce)<\/strong> <\/strong>\u662f\u6307\u7576\u6309\u9375\u88ab\u6309\u4e0b\u6216\u91cb\u653e\u6642\uff0c\u56e0\u70ba\u7269\u7406\u63a5\u89f8\u7684\u5fae\u5c0f\u6ce2\u52d5\uff0c\u6703\u5c0e\u81f4\u591a\u6b21\u932f\u8aa4\u89f8\u767c\u7684\u73fe\u8c61\u3002\u9019\u7a2e\u60c5\u6cc1\u6703\u8b93\u5fae\u63a7\u5236\u5668\u8aa4\u5224\u70ba\u591a\u6b21\u6309\u9375\u4e8b\u4ef6\uff0c\u5f71\u97ff\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u3002\u70ba\u4e86\u89e3\u6c7a\u9019\u500b\u554f\u984c\uff0c\u6211\u5011\u9700\u8981\u9032\u884c<strong>\u6d88\u6296 (debounce)<\/strong>&nbsp;\u8655\u7406\u3002<\/p>\n\n\n\n<p>\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\u7684\u4e09\u7a2e\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u786c\u4ef6\u6d88\u6296<\/strong>\uff1a \u900f\u904e\u4f7f\u7528 RC \u96fb\u8def\uff08\u96fb\u963b\u548c\u96fb\u5bb9\uff09\u6216\u5c08\u7528\u6d88\u6296\u82af\u7247\u4f86\u904e\u6ffe\u6389\u6309\u9375\u4fe1\u865f\u7684\u566a\u8072\u3002\u96d6\u7136\u9019\u7a2e\u65b9\u6cd5\u6548\u679c\u597d\uff0c\u4f46\u9700\u8981\u984d\u5916\u7684\u786c\u4ef6\u5143\u4ef6\uff0c\u5f9e\u800c\u589e\u52a0\u4e86\u6210\u672c\u3002<\/li>\n\n\n\n<li><strong>\u8edf\u4ef6\u5ef6\u9072\u6cd5<\/strong>\uff1a \u5728\u5075\u6e2c\u5230\u6309\u9375\u89f8\u767c\u5f8c\uff0c\u4f7f\u7528&nbsp;<code>delay()<\/code>&nbsp;\u51fd\u6578\u66ab\u505c\u7a0b\u5f0f\u904b\u884c\u4e00\u6bb5\u6642\u9593\uff0c\u4ee5\u78ba\u4fdd\u4fe1\u865f\u7a69\u5b9a\u3002\u96d6\u7136\u9019\u7a2e\u65b9\u6cd5\u7c21\u55ae\uff0c\u4f46\u5b83\u6703\u963b\u585e\u7a0b\u5f0f\u7684\u57f7\u884c\uff0c\u7121\u6cd5\u540c\u6642\u8655\u7406\u5176\u4ed6\u4e8b\u4ef6\uff0c\u5f71\u97ff\u7cfb\u7d71\u7684\u97ff\u61c9\u901f\u5ea6\u3002<\/li>\n\n\n\n<li><strong>\u8a08\u6642\u6cd5<\/strong>\uff1a \u4f7f\u7528\u8a08\u6642\u5668\u4f86\u6aa2\u67e5\u6309\u9375\u4fe1\u865f\u662f\u5426\u7a69\u5b9a\uff0c\u53ea\u6709\u5728\u4fe1\u865f\u7a69\u5b9a\u4e00\u6bb5\u6642\u9593\u5f8c\uff0c\u624d\u78ba\u8a8d\u70ba\u6709\u6548\u7684\u6309\u9375\u4e8b\u4ef6\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u672c\u6587\u5c07\u91cd\u9ede\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528 ESP32 \u7684<strong>\u8a08\u6642\u6cd5<\/strong>\u4f86\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\u554f\u984c\u3002\u9019\u7a2e\u65b9\u6cd5\u9ad8\u6548\u3001\u7cbe\u78ba\uff0c\u4e26\u4e14\u4e0d\u6703\u5f71\u97ff\u4e3b\u5faa\u74b0\u7684\u904b\u884c\uff0c\u7279\u5225\u9069\u5408\u9700\u8981\u8655\u7406\u591a\u500b\u4efb\u52d9\u7684\u60c5\u5883\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-use-dma-and-i-2-s-with-adc-on-esp-32\">\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>\u5b89\u88dd <a href=\"https:\/\/www.arduino.cc\" target=\"_blank\" rel=\"noopener\">Arduino IDE<\/a> \u548c <a href=\"https:\/\/saludpcb.com\/zh\/quick-easy-steps-to-use-arduino-ide-for-esp32-ble\/\">ESP32<\/a> \u958b\u767c\u74b0\u5883\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=\"1-\u521d\u59cb\u5316-uart-\u914d\u7f6e\"><strong>\u4f7f\u7528 Arduino ESP32 Timing \u8655\u7406<\/strong>\u6309\u9375\u5f48\u8df3<\/h2>\n\n\n\n<p>\u975e\u963b\u585e\u5f0f\u8a08\u6642\u6cd5\uff0c\u4e26\u4f7f\u7528 <strong>Arduino ESP32 \u7684 Timing \u8655\u7406\u6309\u9375\u5f48\u8df3<\/strong> :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"cpp\" class=\"language-cpp\">const int buttonPin = 2;\nvolatile unsigned long lastPressTime = 0;\nconst unsigned long debounceDelay = 50;  \/\/ Debounce delay time (in milliseconds)\nvolatile bool buttonPressed = false;     \/\/ Flag to indicate button press\n\nvoid IRAM_ATTR handleButtonPress() {\n  unsigned long currentTime = millis();\n  if (currentTime - lastPressTime > debounceDelay) {\n    lastPressTime = currentTime;\n    buttonPressed = true;  \/\/ Set the flag when button is pressed\n  }\n}\n\nvoid setup() {\n  pinMode(buttonPin, INPUT_PULLUP);  \/\/ Set the button pin as input with pull-up resistor\n  attachInterrupt(digitalPinToInterrupt(buttonPin), handleButtonPress, FALLING);  \/\/ Set up interrupt on button press (falling edge)\n  Serial.begin(115200);  \/\/ Initialize serial communication\n}\n\nvoid loop() {\n  \/\/ Main loop can handle other tasks\n  if (buttonPressed) {\n    Serial.println(\"Button pressed!\");  \/\/ Print to serial if button was pressed\n    buttonPressed = false;  \/\/ Reset the flag after processing\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7c21\u55ae\u89e3\u91cb\uff1a\">\u7a0b\u5f0f\u78bc\u89e3\u8aaa<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6309\u9375\u5f15\u8173\u8a2d\u7f6e\uff1a<\/strong>&nbsp;\u6309\u9375\u9023\u63a5\u5230\u7b2c 2 \u865f\u5f15\u8173\uff0c\u4e26\u555f\u7528\u5167\u5efa\u4e0a\u62c9\u96fb\u963b\uff08<code>INPUT_PULLUP<\/code>\uff09\u3002\u9019\u6a23\u53ef\u4ee5\u78ba\u4fdd\u5728\u6309\u9375\u672a\u6309\u4e0b\u6642\uff0c\u8a72\u5f15\u8173\u7684\u96fb\u58d3\u70ba\u9ad8\u3002<\/li>\n\n\n\n<li><strong>\u4e2d\u65b7\u8a2d\u7f6e\uff1a<\/strong>&nbsp;\u4f7f\u7528&nbsp;<code>attachInterrupt()<\/code>&nbsp;\u8a2d\u7f6e\u4e2d\u65b7\uff0c\u76e3\u63a7\u6309\u9375\u7684\u72c0\u614b\u8b8a\u5316\u3002\u7576\u6309\u9375\u88ab\u6309\u4e0b\u6642\uff0c\u89f8\u767c\u4e0b\u964d\u6cbf\uff08<code>FALLING<\/code>\uff09\uff0c\u5373\u5f9e\u9ad8\u96fb\u5e73\u8b8a\u70ba\u4f4e\u96fb\u5e73\u6642\uff0c\u6703\u547c\u53eb&nbsp;<code>handleButtonPress<\/code>&nbsp;\u51fd\u6578\u3002<\/li>\n\n\n\n<li><strong>\u6d88\u6296\u908f\u8f2f\uff1a<\/strong>&nbsp;\u5728&nbsp;<code>handleButtonPress<\/code>&nbsp;\u51fd\u6578\u4e2d\uff0c\u6211\u5011\u4f7f\u7528&nbsp;<code>millis()<\/code>&nbsp;\u51fd\u6578\u4f86\u7372\u53d6\u7576\u524d\u7684\u6642\u9593\uff08\u4ee5\u6beb\u79d2\u70ba\u55ae\u4f4d\uff09\uff0c\u4e26\u8207\u4e0a\u6b21\u6309\u9375\u6309\u4e0b\u7684\u6642\u9593\u9032\u884c\u6bd4\u8f03\u3002\u5982\u679c\u5169\u6b21\u6309\u9375\u4e8b\u4ef6\u7684\u9593\u9694\u5927\u65bc\u8a2d\u5b9a\u7684\u6d88\u6296\u5ef6\u9072\u6642\u9593\uff08<code>debounceDelay<\/code>\uff09\uff0c\u5247\u8a8d\u70ba\u9019\u6b21\u6309\u9375\u6309\u4e0b\u662f\u6709\u6548\u7684\uff0c\u4e26\u57f7\u884c\u76f8\u95dc\u64cd\u4f5c\u3002<\/li>\n\n\n\n<li><strong>\u4e32\u53e3\u8f38\u51fa\uff1a<\/strong>&nbsp;\u7576\u6309\u9375\u6309\u4e0b\u4e14\u7d93\u904e\u6d88\u6296\u8655\u7406\u5f8c\uff0c\u6703\u5728\u4e32\u53e3\u76e3\u8996\u5668\u4e2d\u986f\u793a&nbsp;<code>\"Button pressed!\"<\/code>\uff0c\u7528\u4f86\u6307\u793a\u6309\u9375\u5df2\u6210\u529f\u89f8\u767c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u9019\u7a2e\u65b9\u6cd5\u80fd\u5920\u9ad8\u6548\u5730\u8655\u7406\u6309\u9375\u4e8b\u4ef6\uff0c\u907f\u514d\u4e86\u963b\u585e\u4e3b\u5faa\u74b0\uff0c\u4e26\u4e14\u901a\u904e&nbsp;<code>millis()<\/code>&nbsp;\u4f86\u5be6\u73fe\u6d88\u6296\uff0c\u6709\u6548\u907f\u514d\u4e86\u6309\u9375\u5f48\u8df3\u554f\u984c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6\">\u8f38\u51fa<\/h2>\n\n\n\n<p>\u7576\u4f60\u904b\u884c\u9019\u6bb5\u7a0b\u5f0f\u6642\uff0c<strong>Serial Monitor<\/strong>&nbsp;\u6703\u986f\u793a\u4ee5\u4e0b\u8f38\u51fa\uff0c\u5047\u8a2d\u4f60\u6309\u4e0b\u6309\u9375\u4e26\u91cb\u653e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">Button pressed!<\/code><\/pre>\n\n\n\n<p>\u9019\u6a23\uff0c\u4f60\u53ef\u4ee5\u5be6\u6642\u770b\u5230\u6309\u9375\u7684\u72c0\u614b\u8b8a\u5316\u3002\u5982\u679c\u9700\u8981\u66f4\u591a\u8a73\u7d30\u7684\u8a0a\u606f\u6216\u8b8a\u6578\uff0c\u4f60\u53ef\u4ee5\u6839\u64da\u9700\u6c42\u5728&nbsp;<code>Serial.println()<\/code>&nbsp;\u4e2d\u52a0\u5165\u5176\u4ed6\u8a0a\u606f\u4f86\u986f\u793a\u7576\u524d\u72c0\u614b\u6216\u6642\u9593\u7b49\u8cc7\u8a0a\u3002<\/p>\n\n\n\n<p><strong>\u63d0\u793a<\/strong>\uff1a\u5982\u679c\u4f60\u9700\u8981\u89c0\u5bdf\u8f38\u51fa\u7d50\u679c\uff0c\u8acb\u78ba\u4fdd\u5728&nbsp;<strong>Arduino IDE<\/strong>&nbsp;\u4e2d\u6253\u958b&nbsp;<strong>Serial Monitor<\/strong>\uff08\u4f4d\u65bc\u53f3\u4e0a\u89d2\u7684\u653e\u5927\u93e1\u5716\u6a19\uff09\uff0c\u4e26\u5c07\u6ce2\u7279\u7387\u8a2d\u7f6e\u70ba&nbsp;<strong>115200<\/strong>\uff0c\u4ee5\u5339\u914d\u7a0b\u5f0f\u4e2d\u7684&nbsp;<code>Serial.begin(115200);<\/code>&nbsp;\u8a2d\u5b9a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">\u7d50\u8ad6<\/h2>\n\n\n\n<p>\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u4f7f\u7528 ESP32 \u8655\u7406<a href=\"https:\/\/en.wikipedia.org\/wiki\/Switch\" target=\"_blank\" rel=\"noopener\">\u6309\u9375\u5f48\u8df3<\/a>\u554f\u984c\uff0c\u4e26\u900f\u904e\u8a08\u6642\u6cd5\u548c\u4e2d\u65b7\u4f86\u5be6\u73fe\u9ad8\u6548\u3001\u6e96\u78ba\u7684\u6d88\u6296\u8655\u7406\u3002\u4f7f\u7528\u8a08\u6642\u6cd5\uff0c\u6211\u5011\u80fd\u5920\u907f\u514d\u50b3\u7d71\u7684\u5ef6\u9072\u6cd5\u6240\u5e36\u4f86\u7684\u963b\u585e\u554f\u984c\uff0c\u4e26\u5728\u4e0d\u5f71\u97ff\u4e3b\u5faa\u74b0\u7684\u60c5\u6cc1\u4e0b\u7cbe\u78ba\u5730\u8655\u7406\u6309\u9375\u4e8b\u4ef6\u3002\u9019\u7a2e\u65b9\u6cd5\u4e0d\u50c5\u80fd\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\uff0c\u9084\u80fd\u4fdd\u8b49\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u8207\u6548\u80fd\u3002<\/p>\n\n\n\n<p>\u5177\u9ad4\u4f86\u8aaa\uff0c\u4f7f\u7528\u4e2d\u65b7\u548c\u8a08\u6642\u6cd5\u7684\u65b9\u6848\u6709\u4ee5\u4e0b\u512a\u9ede\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9ad8\u6548\u6027\uff1a<\/strong>&nbsp;\u4e2d\u65b7\u80fd\u5728\u6309\u9375\u89f8\u767c\u6642\u5373\u523b\u8655\u7406\uff0c\u7121\u9700\u7b49\u5f85\uff0c\u907f\u514d\u4e86\u4e0d\u5fc5\u8981\u7684\u5ef6\u9072\u3002<\/li>\n\n\n\n<li><strong>\u7cbe\u78ba\u6027\uff1a<\/strong>&nbsp;\u4f7f\u7528&nbsp;<code>millis()<\/code>&nbsp;\u51fd\u6578\u4f86\u6aa2\u67e5\u6309\u9375\u662f\u5426\u7a69\u5b9a\uff0c\u78ba\u4fdd\u53ea\u6709\u6709\u6548\u7684\u6309\u9375\u4e8b\u4ef6\u6703\u88ab\u89f8\u767c\u3002<\/li>\n\n\n\n<li><strong>\u975e\u963b\u585e\uff1a<\/strong>&nbsp;\u9019\u7a2e\u65b9\u6cd5\u4e0d\u6703\u963b\u585e\u4e3b\u5faa\u74b0\uff0c\u4e3b\u5faa\u74b0\u53ef\u4ee5\u540c\u6642\u8655\u7406\u5176\u4ed6\u4efb\u52d9\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u7e3d\u7d50\u4f86\u8aaa\uff0c\u8a08\u6642\u6cd5\u662f\u89e3\u6c7a\u6309\u9375\u5f48\u8df3\u554f\u984c\u7684\u4e00\u500b\u975e\u5e38\u7406\u60f3\u7684\u9078\u64c7\uff0c\u7279\u5225\u662f\u5728\u9700\u8981\u5373\u6642\u53cd\u61c9\u548c\u9ad8\u6548\u8655\u7406\u7684\u5d4c\u5165\u5f0f\u61c9\u7528\u4e2d\u3002\u900f\u904e\u9019\u7a2e\u65b9\u6cd5\uff0c\u6211\u5011\u80fd\u5920\u5be6\u73fe\u7a69\u5b9a\u7684\u6309\u9375\u8f38\u5165\uff0c\u63d0\u5347\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/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","protected":false},"excerpt":{"rendered":"<p>\u6309\u9375\u5f48\u8df3 (Key Bounce) \u662f\u96fb\u5b50\u9805\u76ee\u4e2d\u5e38\u898b\u7684\u6311\u6230\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528\u6a5f\u68b0\u6309\u9375\u6642\u66f4\u70ba\u7a81\u51fa\u3002\u7531\u65bc\u6309\u9375\u63a5\u89f8\u7684\u4e0d\u7a69 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3213,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,53,83],"tags":[61,27,63,20,60,10,64,11,62],"class_list":["post-3206","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-module","category-esp32","category-featured","tag-bluetooth","tag-c","tag-firmware","tag-hardware","tag-iot","tag-mcu","tag-module","tag-tutorial","tag-wifi"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3206","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=3206"}],"version-history":[{"count":11,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3206\/revisions"}],"predecessor-version":[{"id":3222,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/posts\/3206\/revisions\/3222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/media\/3213"}],"wp:attachment":[{"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/media?parent=3206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/categories?post=3206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saludpcb.com\/zh\/wp-json\/wp\/v2\/tags?post=3206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}