{"id":628,"date":"2022-11-22T17:30:10","date_gmt":"2022-11-22T09:30:10","guid":{"rendered":"http:\/\/wordpress.loc\/?p=628"},"modified":"2023-02-22T20:48:37","modified_gmt":"2023-02-22T12:48:37","slug":"esp32_ch1-18","status":"publish","type":"post","link":"https:\/\/www.nmking.io\/index.php\/2022\/11\/22\/628\/","title":{"rendered":"\u7b2c16\u7bc7 ESP32 \u85cd\u82bdBT\u9023\u7dda\uff1a\u5373\u6642\u901a\u8a0a\u8207\u8a9e\u97f3\u6307\u4ee4"},"content":{"rendered":"\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u672c\u7ae0\u5c07\u4ecb\u7d39ESP32\u7684\u85cd\u82bd\u901a\u8a0a\uff0c\u85cd\u82bd\u8207WiFi\u90fd\u662f\u7528\u4f86\u901a\u8a0a\uff0c\u85cd\u82bd\u901a\u5e38\u7528\u65bc\u8fd1\u7aef\u9ede\u5c0d\u9ede\u901a\u8a0a\uff0cWiFi\u5247\u5e38\u7528\u4f86\u9023\u5165\u7db2\u969b\u7db2\u8def\uff0c\u6240\u8b02\u7684\u9ede\u5c0d\u9ede\u5c31\u50cf\u662f\u85cd\u82bd\u7121\u7dda\u8033\u6a5f\u8207\u624b\u6a5f\u9023\u63a5<\/p><\/blockquote><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-ht-block-toc is-style-rounded htoc htoc--position-wide toc-list-style-plain\" data-htoc-state=\"expanded\"><span class=\"htoc__title\"><span class=\"ht_toc_title\">Table of Contents<\/span><span class=\"htoc__toggle\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\"><g fill=\"#444\"><path d=\"M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><path d=\"M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><\/g><\/svg><\/span><\/span><div class=\"htoc__itemswrap\"><ul class=\"ht_toc_list\"><li class=\"\"><a href=\"#htoc-\">\u5be6\u4f5c\u8aaa\u660e<\/a><\/li><li class=\"\"><a href=\"#htoc-1\">\u4e00\u3001\u85cd\u82bd\u55ae\u5411\u50b3\u8f38<\/a><\/li><li class=\"\"><a href=\"#htoc-11\">\u4e8c\u3001\u85cd\u82bd\u96d9\u5411\u50b3\u8f38<\/a><ul class=\"ht_toc_child_list\"><li class=\"\"><a href=\"#htoc-esp32\">\u53ef\u4ee5\u53cd\u904e\u4f86\u8b93\u624b\u6a5f\u50b3\u8cc7\u6599\u5230ESP32\u55ce\uff1f<\/a><\/li><li class=\"\"><a href=\"#htoc-esp321\">\u6211\u5011\u8981\u5982\u4f55\u8b93ESP32\u4e5f\u80fd\u6253\u5b57\u56de\u8986\uff1f<\/a><\/li><\/ul><\/li><li class=\"\"><a href=\"#htoc-111\">\u4e09\u3001\u85cd\u82bd\u6307\u4ee4\u8207\u8a9e\u97f3\u8fa8\u8b58<\/a><ul class=\"ht_toc_child_list\"><li class=\"\"><a href=\"#htoc-1111\">\u9019\u6a23\u7684\u7a0b\u5f0f\u53ea\u80fd\u62ff\u4f86\u85cd\u82bd\u804a\u5929\u55ce\uff1f<\/a><\/li><li class=\"\"><a href=\"#htoc-0\">\u6309\u9215\u63a7\u5236\u529f\u80fd<\/a><\/li><li class=\"\"><a href=\"#htoc-11111\">\u8a9e\u97f3\u6307\u4ee4\u529f\u80fd<\/a><\/li><\/ul><\/li><\/ul><\/div><\/div>\n\n\n\n<p>\u6211\u7684ESP32\u5be6\u505a\u66f8\u7c4d\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/10\/esp32_ch1-2\/\" target=\"_blank\">\u6211\u51fa\u66f8\u4e86 ESP32 \u7269\u806f\u7db2\u5c08\u984c<\/a><br>\u535a\u5ba2\u4f86\u7db2\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.books.com.tw\/products\/0010901195\" target=\"_blank\">https:\/\/www.books.com.tw\/products\/0010901195<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-\">\u5be6\u4f5c\u8aaa\u660e<\/h2>\n\n\n\n<p>\u672c\u7ae0\u5c07\u4ecb\u7d39ESP32\u7684\u85cd\u82bd\u901a\u8a0a\uff0c\u85cd\u82bd\u8207WiFi\u90fd\u662f\u7528\u4f86\u901a\u8a0a\uff0c\u85cd\u82bd\u901a\u5e38\u7528\u65bc\u8fd1\u7aef\u9ede\u5c0d\u9ede\u901a\u8a0a\uff0cWiFi\u5247\u5e38\u7528\u4f86\u9023\u5165\u7db2\u969b\u7db2\u8def\uff0c\u6240\u8b02\u7684\u9ede\u5c0d\u9ede\u5c31\u50cf\u662f\u85cd\u82bd\u7121\u7dda\u8033\u6a5f\u8207\u624b\u6a5f\u9023\u63a5\uff0c\u7528\u4f86\u64ad\u653e\u97f3\u6a02\uff0c\u6216\u8005\u85cd\u82bd\u6ed1\u9f20\u9375\u76e4\u529f\u80fd\u662f\u8f38\u5165\u6587\u5b57\uff0c\u53ea\u662f\u4e00\u7a2e\u5e8f\u5217\u901a\u8a0a\uff0c\u529f\u80fd\u8f03\u70ba\u7c21\u55ae\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u50cfWiFi\u9019\u6a23\u592a\u8907\u96dc\u7684\u8a2d\u5b9a\uff0c\u4e0d\u904e\u85cd\u82bd\u96d6\u7136\u7c21\u55ae\uff0c\u4f46\u662f\u4f7f\u7528\u4e0a\u65b9\u4fbf\uff0c\u53ea\u8981\u914d\u5c0d\u5c31\u53ef\u4ee5\u53d6\u7528\u670d\u52d9\uff0c\u6240\u4ee5\u4e5f\u975e\u5e38\u6d41\u884c\u3002<br><br>\u8207\u85cd\u82bd\u540c\u4f4d\u968e\u7684\u61c9\u8a72\u7b97\u662f\u7d05\u5916\u7dda\uff0c\u4e0d\u904e\u7d05\u5916\u7dda\u6709\u65b9\u5411\u6027\uff0c\u662f\u8981\u5c0d\u6e96\u88dd\u7f6e\u624d\u80fd\u50b3\u8f38\uff0c\u901f\u5ea6\u6162\u4e0d\u8aaa\uff0c\u8ddd\u96e2\u5927\u6982\u4e0d\u80fd\u8d85\u904e10\u516c\u5c3a\uff0c\u800c\u85cd\u82bd\u5247\u7121\u65b9\u5411\u6027\uff0c\u56e0\u6b64\u4e0d\u7528\u5c0d\u6e96\uff0c\u800c\u4e14\u50b3\u8f38\u8ddd\u96e2\u9060\u3001\u901f\u5ea6\u4e5f\u6bd4\u7d05\u5916\u7dda\u5feb\u5f88\u591a\u3002<br><br>\u672c\u66f8\u5c07\u6703\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528ESP32\u85cd\u82bd\u8207\u624b\u6a5f\u9023\u7dda\u901a\u8a0a\uff0c\u4e26\u900f\u904e\u624b\u6a5f\u7684\u8a9e\u97f3\u8fa8\u8b58\u9059\u63a7\u96fb\u98a8\u6247\u53ca\u6aaf\u71c8\uff0c\u6b64\u5916\u4e5f\u6703\u4ecb\u7d39\u6700\u65b0\u7684ibeacon\u5ba4\u5167\u5b9a\u4f4d\u88dd\u7f6e\u539f\u7406\u53ca\u5be6\u505a\u3002\u672c\u7ae0\u5148\u7c21\u4ecbESP32\u7684\u85cd\u7259\u901a\u8a0a\u8a2d\u5b9a\u8207\u4f7f\u7528\uff0c\u7531\u65bc\u662f\u85cd\u82bd\u5167\u5efa\u7684\uff0c\u6240\u4ee5\u4e0d\u7528\u63a5\u7dda\u6216\u8a2d\u5b9aAT COMMAND\uff0c\u4e5f\u4e0d\u7528\u5ba3\u544aTXRX\u76f8\u95dc\u7684\u901a\u8a0a\u5354\u5b9a\uff0c\u800c\u4e14ESP32\u5167\u5efa\u7684\u85cd\u82bd\u662f\u63a1\u7528\u4f4e\u529f\u7387\u85cd\u82bd\uff08BLE\uff1aBluetooth Low Energy\uff09\u8017\u96fb\u91cf\u8f03\u5c11\uff0c\u50b3\u8f38\u8ddd\u96e2\u7406\u8ad6\u53ef\u9054300\u516c\u5c3a\u9060\uff0c\u5be6\u969b\u6e2c\u8a6630\u516c\u5c3a\u6c92\u554f\u984c\uff0c\u800c\u5e38\u898b\u642d\u914dUNO\u4f7f\u7528\u7684HC-05\u5c6c\u65bc\u85cd\u82bd2.1\uff0c\u7406\u8ad6\u50b3\u8f38\u8ddd\u96e2\u53ea\u670910\u516c\u5c3a\uff0c\u672c\u7ae0\u5c07\u4ecb\u7d39\u5982\u4f55\u7684\u555f\u52d5ESP32\u85cd\u82bd\u88dd\u7f6e\uff0c\u4e26\u642d\u914dAndroid\u624b\u6a5f\u9032\u884c\u901a\u8a0a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-1\">\u4e00\u3001\u85cd\u82bd\u55ae\u5411\u50b3\u8f38<\/h2>\n\n\n\n<p>\u672c\u7bc0\u8aaa\u660e\u4f7f\u7528ESP32\u85cd\u82bd\u5c07\u8cc7\u8a0a\u50b3\u905e\u7d66\u85cd\u82bd\u88dd\u7f6e\uff08\u624b\u6a5f\uff09\u9032\u884c\u63a5\u6536\uff0c\u7531\u65bcbluetooth\u51fd\u5f0f\u5eabiOS\u624b\u6a5f\u4e0d\u76f8\u5bb9\u7684\u539f\u56e0\uff0c\u5f8c\u7e8c\u7ae0\u7bc0\u90fd\u5c07\u4f7f\u7528Android\u88dd\u7f6e\u9032\u884c\u89e3\u8aaa\u3002<br>ESP32\u85cd\u82bd\u7684\u958b\u555f\u50c5\u9700\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528\u85cd\u82bd\u51fd\u5f0f\u5eab\uff1a#include<\/li>\n\n\n\n<li>\u5ba3\u544a\u85cd\u82bd\u5e8f\u5217\u901a\u8a0a\u7269\u4ef6\uff1aBluetoothSerial BT;\/\/BT\u70ba\u85cd\u82bd\u901a\u8a0a\u7269\u4ef6<\/li>\n\n\n\n<li>\u5728Setup\u4e2d\u958b\u555f\u85cd\u82bd\uff1aBT.begin(&#8220;BTName&#8221;);\/\/ BTName\u70ba\u85cd\u82bd\u5ee3\u64ad\u540d\u7a31<\/li>\n\n\n\n<li>\u7576\u8981\u50b3\u8f38\u8cc7\u8a0a\u6642\uff1aBT.print(&#8220;\u8981\u50b3\u8f38\u7684\u6587\u5b57&#8221;);\/\/println\u5247\u662f\u63db\u884c<\/li>\n<\/ol>\n\n\n\n<p>\u6211\u5011\u5148\u4f86\u4e00\u500b\u7c21\u55ae\u7684\u6e2c\u8a66\uff0c\u5c31\u662f\u6bcf\u79d2\u50b3\u8f38\u4e00\u6b21&#8221;Hello World!&#8221;\u5230\u624b\u6a5f\u4e2d\uff0c\u7a0b\u5f0f\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;BluetoothSerial.h>\nBluetoothSerial BT;\/\/\u5ba3\u544a\u85cd\u82bd\u7269\u4ef6\uff0c\u540d\u7a31\u70baBT\n\nvoid setup() {\nSerial.begin(115200);\nBT.begin(\"Eric1030\");\/\/\u8acb\u6539\u540d\u4f8b\u5982\u82f1\u6587+\u751f\u65e5\uff0c\u4ee5\u514d\u8207\u5176\u4ed6\u540c\u5b78\u540d\u7a31\u91cd\u8907\n}\n\nvoid loop() {\n  BT.println(\"Hello World!\");\n  delay(1000);\n}<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6210\u7a0b\u5f0f\u4e0a\u50b3\u5f8c\uff0c\u6211\u5011\u4f86\u8655\u7406\u624b\u6a5f\u7684\u90e8\u4efd\uff0c\u8acb\u5c07Android\u624b\u6a5f\u958b\u555fApp store\uff0c\u4e26\u641c\u5c0bArduino Bluetooth Control\uff0c\u5176\u5716\u793a\u5982\u4e0b\uff0cAPP Store\u6709\u5f88\u591a\u985e\u4f3c\u7684APP\u5176\u5be6\u529f\u80fd\u90fd\u5dee\u4e0d\u591a\uff0c\u4f46\u662f\u6211\u5011\u9078\u5b9a\u7684\u9019\u500bAPP\u6709\u63d0\u4f9b\u8a9e\u97f3\u8fa8\u8b58\u7684\u529f\u80fd\uff0c\u5f8c\u7e8c\u7df4\u7fd2\u5c07\u6703\u7528\u5230\u3002<\/p>\n\n\n\n<p class=\"quote\">\u8b80\u8005\u82e5\u7121\u6cd5\u627e\u5230\u8a72APP\uff0c\u53ef\u80fd\u662f\u7248\u672c\u4e0d\u76f8\u5bb9\uff0c\u4f46\u53ef\u5f9e\u7b46\u8005\u96f2\u7aef\u7a7a\u9593\u4e2d\u4e0b\u8f09\u5099\u4efdAPK\u6a94\u6848\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/t.ly\/YRWpD\" target=\"_blank\">https:\/\/t.ly\/YRWpD<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927289-2069979845.png?resize=839%2C305&#038;ssl=1\" alt=\"\" width=\"839\" height=\"305\"\/><figcaption class=\"wp-element-caption\">Arduino Bluetooth Control\uff08Google Play\u7db2\u5740\uff1ahttps:\/\/t.ly\/eA2R3\uff09<\/figcaption><\/figure>\n\n\n\n<p>\u624b\u6a5f\u5b89\u88dd\u597dAPP\u5f8c\uff0c\u555f\u52d5\u85cd\u82bd\u9023\u7dda\u8a2d\u5b9a\u5982\u57162\uff0c\u5982\u679c\u672a\u5728\u53ef\u7528\u88dd\u7f6e\u4e2d\u51fa\u73fe\u8acb\u9ede\u9078\u4e0d\u5e38\u7528\u985e\u578b\u88dd\u7f6e\uff0c\u60a8\u6240\u8a2d\u5b9a\u7684ESP32\u85cd\u82bd\u540d\u7a31\u5c31\u6703\u51fa\u73fe\u5728\u9019\u88e1\uff08\u5982\u57163\uff09\uff0c\u9ede\u9078\u60a8\u7684ESP\u88dd\u7f6e\u5c31\u6703\u51fa\u73fe\u914d\u5c0d\u8a0a\u606f\uff08\u5982\u57164\uff09\uff0c\u9ede\u9078\u4e0b\u65b9\u7684\u914d\u5c0d\u5373\u53ef\u5b8c\u6210\u914d\u5c0d\uff08\u5982\u57165\uff09\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927395-1938158636.png?resize=286%2C422&#038;ssl=1\" alt=\"\" width=\"286\" height=\"422\"\/><figcaption class=\"wp-element-caption\">\u57162\uff1a\u958b\u555f\u85cd\u82bd\u8a2d\u5b9a<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927399-691414267.png?resize=283%2C417&#038;ssl=1\" alt=\"\" width=\"283\" height=\"417\"\/><figcaption class=\"wp-element-caption\">\u57163\uff1a\u85cd\u82bd\u4e0d\u5e38\u7528\u88dd\u7f6e\u5217\u8868<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927404-2506140117.png?resize=283%2C480&#038;ssl=1\" alt=\"\" width=\"283\" height=\"480\"\/><figcaption class=\"wp-element-caption\">\u57164\uff1a\u958b\u59cb\u914d\u5c0d<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927407-2212519844.png?resize=281%2C476&#038;ssl=1\" alt=\"\" width=\"281\" height=\"476\"\/><figcaption class=\"wp-element-caption\">\u57165\uff1a\u914d\u5c0d\u5b8c\u6210<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u5b8c\u6210\u914d\u5c0d\u5f8c\uff0c\u958b\u555f\u525b\u525b\u5b89\u88dd\u7684Arduino Bluetooth Control APP\uff0c\u82e5\u6c92\u6709\u81ea\u52d5\u9023\u7dda\uff0c\u5247\u9ede\u9078\u4e0a\u65b9\u7684\u7bad\u982d\u5716\u793a\u9078\u64c7\u8981\u672c\u6b21\u8981\u9023\u7dda\u7684ESP32\u88dd\u7f6e\uff08\u5982\u57166\uff09\u3002<br>\u9023\u7dda\u6210\u529f\u6642\uff0c\u4e0b\u65b9\u6703\u51fa\u73fe\u300cConnected to \u88dd\u7f6e\u540d\u7a31\u300d\u7684\u8a0a\u606f\uff08\u5982\u57167\uff09\uff0c\u6b64\u6642\u518d\u9ede\u9078\u5e8f\u5217\u901a\u8a0a\u7684\u529f\u80fd\uff0c\u5373\u53ef\u770b\u5230\u6bcf\u79d2\u4e00\u6b21\u7684\u300cHello World!\u300d\u8a0a\u606f\uff08\u5982\u57168\uff09\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927548-577483744.png?resize=274%2C532&#038;ssl=1\" alt=\"\" width=\"274\" height=\"532\"\/><figcaption class=\"wp-element-caption\">\u57166\uff1a\u958b\u555fAPP\u9023\u7dda\u85cd\u82bd\u88dd\u7f6e<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927551-2403875176.png?resize=275%2C528&#038;ssl=1\" alt=\"\" width=\"275\" height=\"528\"\/><figcaption class=\"wp-element-caption\">\u57167\uff1a\u7b49\u5019\u9023\u7dda\u6210\u529f\uff08connected\uff09<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927556-302767756.png?resize=276%2C459&#038;ssl=1\" alt=\"\" width=\"276\" height=\"459\"\/><figcaption class=\"wp-element-caption\">\u57168\uff1a\u9ede\u9078\u53f3\u4e0a\u5e8f\u5217\u901a\u8a0a\u529f\u80fd<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927558-2549461574.png?resize=276%2C459&#038;ssl=1\" alt=\"\" width=\"276\" height=\"459\"\/><figcaption class=\"wp-element-caption\">\u57169\uff1a\u89c0\u5bdf\u50b3\u5165\u7684\u8cc7\u8a0a<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u63a5\u4e0b\u4f86\u6211\u5011\u4f7f\u7528DHT11\u6eab\u6fd5\u5ea6\u8a08\u70ba\u7bc4\u4f8b\uff0c\u5c07\u6eab\u6fd5\u5ea6\u7684\u503c\u50b3\u5165\u624b\u6a5f\u4e2d\uff0c\u95dc\u65bcDHT11\u6eab\u6fd5\u5ea6\u8a08\u7684\u4f7f\u7528\u65b9\u5f0f\u8acb\u53c3\u8003\u524d\u9762\u7ae0\u7bc0\u7684\u5167\u5bb9\uff0c\u53e6\u5916\u6bcf\u6b21ESP32\u66f4\u65b0\u7a0b\u5f0f\u6642\u91cd\u65b0\u555f\u52d5\u6642\uff0cAPP\u90fd\u5fc5\u9808\u6309\u4e00\u4e0b\u9023\u7dda\u7684\u5716\u793a \uff0c\u91cd\u65b0\u8207\u88dd\u7f6e\u5efa\u7acb\u9023\u7dda\uff0c\u624d\u80fd\u8b80\u53d6\u8cc7\u8a0a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;SimpleDHT.h>\n#include &lt;BluetoothSerial.h>\nBluetoothSerial BT;\nint pinDHT11 = 25; \/\/\u672c\u4f8b\u8acb\u5c07\u6eab\u5ea6\u8a08S\u8173\u63a5\u5728\u5de611 (GPIO25)\nSimpleDHT11 dht11(pinDHT11);\n\nvoid setup() {\n  Serial.begin(115200);\n  BT.begin(\"Eric1030\");\/\/\u8acb\u6539\u540d\n}\n\nvoid loop() {\n  \/\/ start working...\n  Serial.println(\"=================================\");\n  Serial.println(\"Sample DHT11...\");\n  \/\/ read without samples.\n  byte temperature = 0;\n  byte humidity = 0;\n  int err = SimpleDHTErrSuccess;\n  if ((err = dht11.read(&amp;temperature, &amp;humidity, NULL)) != SimpleDHTErrSuccess) {\n    Serial.print(\"Read DHT11 failed, err=\"); Serial.println(err); delay(1000);\n    return;\n  }\n  \/\/\u5c07\u6eab\u6fd5\u5ea6\u50b3\u8f38\u5230\u85cd\u82bd\u88dd\u7f6e\n  BT.print((int)temperature);\n  BT.print(\" *C,\");\n  BT.print((int)humidity);\n  BT.println(\" H\");\n  delay(1000); \/\/\u4f11\u606f1\u79d2\n}\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927667-2625540696.png?resize=340%2C529&#038;ssl=1\" alt=\"\" width=\"340\" height=\"529\"\/><figcaption class=\"wp-element-caption\">\u571610\uff1a\u5229\u7528\u85cd\u82bd\u50b3\u8f38DHT11\u6eab\u6fd5\u5ea6<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-11\">\u4e8c\u3001\u85cd\u82bd\u96d9\u5411\u50b3\u8f38<\/h2>\n\n\n\n<p>\u53ea\u6709ESP32\u50b3\u9001\u8cc7\u6599\u5230\u624b\u6a5f<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-esp32\">\u53ef\u4ee5\u53cd\u904e\u4f86\u8b93\u624b\u6a5f\u50b3\u8cc7\u6599\u5230ESP32\u55ce\uff1f<\/h3>\n\n\n\n<p>\u7576\u7136\u53ef\u4ee5\uff0c\u800c\u4e14\u66f4\u597d\u73a9\u3002\u9019\u90e8\u4efdESP32\u7684\u6d41\u7a0b\u662f\u9019\u6a23\u7684<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6aa2\u6e2c\u85cd\u82bd\u662f\u5426\u6709\u8cc7\u6599\uff1aBT.available()<\/li>\n\n\n\n<li>\u5982\u679c\u6709\u8cc7\u6599\uff0c\u6211\u5011\u5c31\u628a\u8cc7\u6599\u8b80\u51fa\uff1aBT.readString()<\/li>\n\n\n\n<li>\u5c07\u8cc7\u6599\u5f9e\u96fb\u8166\u7684\u5e8f\u5217\u8996\u7a97\uff08Serial\uff09\u4e2d\u5370\u51fa\u4f86\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u9019\u90e8\u4efd\u7684\u7a0b\u5f0f\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;BluetoothSerial.h>\nBluetoothSerial BT;\n\nvoid setup() {\n  Serial.begin(115200);\n  BT.begin(\"Eric1030\");\/\/\u8acb\u6539\u540d\n}\nvoid loop() {\n  \/\/\u6aa2\u67e5\u85cd\u82bd\u5167\u662f\u5426\u6709\u8cc7\u6599\n  while (BT.available()) {\n    \/\/\u8b80\u53d6\u85cd\u82bd\u8cc7\u6599\n    String BTdata=BT.readString();\n    \/\/\u986f\u793a\u5728\u5e8f\u5217\u8996\u7a97\n    Serial.println(BTdata);\n  }\n  delay(1);\n}<\/code><\/pre>\n\n\n\n<p>\u9023\u7dda\u6210\u529f\u5f8c\uff0c\u4e00\u6a23\u9ede\u9078\u53f3\u4e0a\u5e8f\u5217\u901a\u8a0a\u529f\u80fd\u5f8c\uff0c\u6b64\u6b21\u5728\u4e0b\u65b9\u7684\u7a7a\u767d\u8655\uff0c\u8f38\u5165\u6587\u5b57\u4e26\u6309\u9375\u76e4\u7684Done\u6216Enter\u9001\u51fa\u5f8c\uff0c\u6211\u5011\u5373\u53ef\u5728\u96fb\u8166\u7684\u5e8f\u5217\u901a\u8a0a\u8996\u7a97\u4e2d\u6536\u5230\u624b\u6a5f\u50b3\u4f86\u7684\u8a0a\u606f\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927745-3660071016.png?resize=290%2C536&#038;ssl=1\" alt=\"\" width=\"290\" height=\"536\"\/><figcaption class=\"wp-element-caption\">\u571611\uff1a\u5728\u624b\u6a5f\u8f38\u5165\u8a0a\u606f<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927748-3389866621.png?resize=369%2C538&#038;ssl=1\" alt=\"\" width=\"369\" height=\"538\"\/><figcaption class=\"wp-element-caption\">\u571612\uff1aESP32\u7684\u5e8f\u5217\u8996\u7a97\u4e2d\u8b80\u53d6\u8a0a\u606f<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u4e0d\u904e\u9019\u6a23\u55ae\u65b9\u9762\u53ea\u80fd\u624b\u6a5f\u8b1b\u8a71\u6709\u9ede\u5b64\u55ae<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-esp321\">\u6211\u5011\u8981\u5982\u4f55\u8b93ESP32\u4e5f\u80fd\u6253\u5b57\u56de\u8986\uff1f<\/h3>\n\n\n\n<p>\u5176\u5be6\u8a9e\u6cd5\u5f88\u985e\u4f3c\uff0c\u53ea\u662f\u8207\u85cd\u82bd\u7684\u65b9\u5411\u76f8\u53cd\uff0c\u5c31\u662f\u6aa2\u67e5\u5e8f\u5217\u662f\u5426\u6709\u8cc7\u6599\u8f38\u5165Serial.available()\uff0c\u7576Serial.available()\u6642\u7528Serial.readString()\u5c07\u8cc7\u6599\u8b80\u5165\u5f8c\uff0c\u518d\u7528BT.println()\u5c07\u8cc7\u6599\u9001\u5230\u624b\u6a5f\u3002\u4e0d\u904eESP32\u8981\u5728\u54ea\u88e1\u6253\u5b57\u5462\uff1f\u662f\u900f\u904e\u5e8f\u5217\u901a\u8a0a\u8996\u7a97\u4e0a\u9762\u7684\u7a7a\u767d\u8655\uff08\u5982\u571613\uff09\uff0c\u672c\u90e8\u4efd\u7a0b\u5f0f\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;BluetoothSerial.h>\nBluetoothSerial BT;\n\nvoid setup() {\n  Serial.begin(115200);\n  BT.begin(\"Eric1030\");\/\/\u8acb\u6539\u540d\n}\n\nvoid loop() {\n  \/\/\u6aa2\u67e5\u5e8f\u5217\u5167\u662f\u5426\u6709\u8cc7\u6599\n  while (Serial.available()) {\n    \/\/\u8b80\u53d6\u5e8f\u5217\u8cc7\u6599\n    String Sdata = Serial.readString();\n    \/\/\u50b3\u8f38\u7d66\u85cd\u82bd\n    BT.println(Sdata);\n  }\n\n  \/\/\u6aa2\u67e5\u85cd\u82bd\u5167\u662f\u5426\u6709\u8cc7\u6599\n  while (BT.available()) {\n    \/\/\u8b80\u53d6\u85cd\u82bd\u8cc7\u6599\n    String BTdata = BT.readString();\n    \/\/\u986f\u793a\u5728\u5e8f\u5217\u8996\u7a97\n    Serial.println(BTdata);\n  }\n  delay(1);\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927916-2758503934.png?resize=518%2C459&#038;ssl=1\" alt=\"\" width=\"518\" height=\"459\"\/><figcaption class=\"wp-element-caption\">\u571613\uff1aESP32\u5728\u5e8f\u5217\u8996\u7a97\u8f38\u5165\u8a0a\u606f<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927920-3110538665.png?resize=280%2C458&#038;ssl=1\" alt=\"\" width=\"280\" height=\"458\"\/><figcaption class=\"wp-element-caption\">\u571614\uff1a\u96d9\u5411\u8cc7\u6599\u50b3\u8f38<\/figcaption><\/figure>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-111\">\u4e09\u3001\u85cd\u82bd\u6307\u4ee4\u8207\u8a9e\u97f3\u8fa8\u8b58<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-1111\">\u9019\u6a23\u7684\u7a0b\u5f0f\u53ea\u80fd\u62ff\u4f86\u85cd\u82bd\u804a\u5929\u55ce\uff1f<\/h3>\n\n\n\n<p>\u5176\u5be6\u9019\u53ef\u4ee5\u7528\u4f86\u9059\u63a7\u4e00\u4e9b\u6771\u897f\uff0c\u4f8b\u5982\u6211\u5011\u7528\u7c21\u55ae\u7684LED\u71c8\u4f86\u6e2c\u8a66\uff0c\u5c07LED\u4f9d\u7167\u524d\u9762\u7684\u5167\u5bb9\u4f9d\u5e8f\u5c07\u7da0\u9ec3\u7d05\u653e\u7f6e\u5728GPIO4,16,17\uff08\u9eb5\u5305\u677f\u53f37,8,9\uff09\u4f4d\u7f6e\uff0c\u63a5\u4e0b\u4f86\u6211\u5011\u5047\u8a2dESP32\u5f9e\u85cd\u82bd\u63a5\u5230\u50b3\u4f86&#8217;1&#8217;\u6642\uff0c\u5c31\u958b\u555f\u7da0LED\uff0c\u800c&#8217;2&#8217;\u4ee3\u8868\u95dc\u9589\u7da0LED\uff0c\u5176\u9918\u96f7\u540c\uff0c&#8217;3&#8221;4&#8217;\u4ee3\u8868\u958b\u555f\u53ca\u95dc\u9589\u9ec3LED\uff0c&#8217;5&#8221;6&#8217;\u4ee3\u8868\u958b\u555f\u53ca\u95dc\u9589\u7d05LED\uff0c\u9019\u6a23\u6211\u5011\u5c31\u53ef\u4ee5\u7528\u624b\u6a5f\u4f86\u9059\u63a7\u4e09\u500b\u71c8\u865f\u3002\u5b8c\u6574\u7a0b\u5f0f\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;BluetoothSerial.h>\nBluetoothSerial BT;\n\nvoid setup() {\n  Serial.begin(115200);\n  BT.begin(\"Eric1030\");\/\/\u8acb\u6539\u540d\n  pinMode(15, OUTPUT); \/\/\u7da0\u8272LED\n  pinMode(2, OUTPUT); \/\/\u9ec3\u8272LED\n  pinMode(4, OUTPUT); \/\/\u7d05\u8272LED\n}\n\nvoid loop() {\n  \/\/\u6aa2\u67e5\u5e8f\u5217\u5167\u662f\u5426\u6709\u8cc7\u6599\n  while (Serial.available()) {\n    \/\/\u8b80\u53d6\u5e8f\u5217\u8cc7\u6599\n    String Sdata = Serial.readString();\n    \/\/\u50b3\u8f38\u7d66\u85cd\u82bd\n    BT.print(Sdata);\n  }\n\n  \/\/\u6aa2\u67e5\u85cd\u82bd\u5167\u662f\u5426\u6709\u8cc7\u6599\n  while (BT.available()) {\n    \/\/\u8b80\u53d6\u85cd\u82bd\u8cc7\u6599\n    String BTdata = BT.readString();\n    \/\/\u986f\u793a\u5728\u5e8f\u5217\u8996\u7a97\n    Serial.println(BTdata);\n    \/\/\u6aa2\u67e5\u85cd\u82bd\u8cc7\u6599\u53ca\u76f8\u5c0d\u7684\u6307\u4ee4\n    if (BTdata == \"1\") {\n      \/\/1\uff1a\u958b\u7da0\u71c8\n      digitalWrite(15, HIGH);\n    }\n    if (BTdata == \"2\") {\n      \/\/2\uff1a\u95dc\u7da0\u71c8\n      digitalWrite(15, LOW);\n    }\n    if (BTdata == \"3\") {\n      \/\/3\uff1a\u958b\u9ec3\u71c8\n      digitalWrite(2, HIGH);\n    }\n    if (BTdata == \"4\") {\n      \/\/4\uff1a\u95dc\u7da0\u71c8\n      digitalWrite(2, LOW);\n    }\n    if (BTdata == \"5\") {\n      \/\/5\uff1a\u958b\u7d05\u71c8\n      digitalWrite(4, HIGH);\n    }\n    if (BTdata == \"6\") {\n      \/\/6\uff1a\u95dc\u7d05\u71c8\n      digitalWrite(4, LOW);\n    }\n\n  }\n  delay(1);\n}<\/code><\/pre>\n\n\n\n<p>\u6211\u5011\u5c07\u6578\u5b571\uff5e6\u6309\u904e\u4e00\u6b21\uff0c\u5c31\u6703\u767c\u73fe\u71c8\u865f\u4f9d\u5e8f\u4eae\u8d77\u7184\u6ec5\uff0c\u4ee3\u8868\u85cd\u82bd\u50b3\u8f38\u6b63\u5e38\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585927996-4011203442.png?resize=402%2C436&#038;ssl=1\" alt=\"\" width=\"402\" height=\"436\"\/><figcaption class=\"wp-element-caption\">\u571615\uff1a\u5c07\u6578\u5b571-6\u8f38\u5165\uff0c\u67e5\u770b\u71c8\u865f\u8b8a\u5316<\/figcaption><\/figure>\n\n\n\n<p>\u9664\u4e86\u4f7f\u7528\u5e8f\u5217\u901a\u8a0a\u7528\u81ea\u5df1\u6253\u5b57\u7684\u65b9\u5f0f\u4e4b\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528APP\u4e0a\u5176\u4ed6\u7684\u529f\u80fd\uff0c\u6211\u5011\u5148\u4f86\u770b\u770b\u5de6\u5074\u4e0a\u65b9\u7684\u65b9\u5411\u9375\uff0c\u6211\u5011\u9ede\u9078\u4e0d\u540c\u65b9\u5411\u6642\uff0c\u89c0\u5bdf\u7372\u5f97\u7684\u8cc7\u8a0a\uff0c\u6703\u767c\u73fe\u5176\u5be6\u6bcf\u500b\u65b9\u5411\u5c0d\u61c9\u7684\u662f\u4e00\u500b\u6578\u5b57\uff08\u5982\u571617)<br>\u56e0\u6b64\u6309\u4e0b\u4e0d\u540c\u65b9\u5411\uff0c\u525b\u597d\u53ef\u4ee5\u63a7\u5236\u71c8\u865f\uff0c\u4f8b\u5982\u300c^\u300d\u5c0d\u61c9\u6578\u5b57\u300c1\u300d\uff0c\u6240\u4ee5\u6309\u300c^\u300d\u5c31\u6703\u958b\u555f\u7da0\u71c8\uff0c\u5728\u6309\u9215\u6642\u8981\u8acb\u8b80\u8005\u6162\u6162\u6309\uff0c\u4e0d\u8981\u592a\u6025\uff0c\u5426\u5247\u4ed6\u6703\u5c07\u5f88\u591a\u6578\u5b57\u5408\u6210\u4e00\u500b\u5b57\u4e32\u624d\u9001\u51fa\uff0c\u4f8b\u5982\u4e00\u76f4\u6309\u5f80\u4e0a\u300c^\u300d\u6703\u9001\u51fa\u300c11111\u300d\uff0c\u800c\u9019\u6a23\u7684\u65b9\u5f0f\u6211\u5011\u7684\u7a0b\u5f0f\u662f\u7121\u6cd5\u5224\u8b80\u7684\uff0c\u56e0\u70ba\u6211\u5011\u662f\u7528\u5b57\u4e32\u6bd4\u5c0d\uff0c\u800c\u975e\u5b57\u5143\u6bd4\u5c0d\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928032-3966074019.png?resize=298%2C481&#038;ssl=1\" alt=\"\" width=\"298\" height=\"481\"\/><figcaption class=\"wp-element-caption\">\u571616\uff1aAPP\u4e0a\u7684\u6240\u6709\u529f\u80fd<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928036-1752259290.png?resize=305%2C480&#038;ssl=1\" alt=\"\" width=\"305\" height=\"480\"\/><figcaption class=\"wp-element-caption\">\u571617\uff1a\u65b9\u5411\u9375\u529f\u80fd<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u800c\u5728\u52a0\u901f\u5668\u4e0a\uff0c\u5247\u5c0d\u61c9\u7684\u65b9\u5411\u8207\u4e0a\u9762\u7684\u65b9\u5411\u9375\u662f\u76f8\u540c\u7684\uff0c\u4e0d\u904e\u4ed6\u7684\u63a7\u5236\u662f\u7528\u624b\u6a5f\u7684\u50be\u659c\u65b9\u5411\u4f86\u63a7\u5236\u9001\u51fa\u7684\u8a0a\u865f\uff0c\u4f8b\u5982\u4f60\u5c07\u624b\u6a5f\u5411\u524d\u50be\u659c\u4e00\u79d2\u9418\u5f8c\u5fa9\u539f\u6c34\u5e73\u72c0\u614b\uff0c\u624b\u6a5f\u6703\u5c0dESP32\u9001\u51fa\u4e00\u9023\u4e32\u7684\u300c11111111\u300d\uff0c\u5411\u5f8c\u5247\u6703\u9001\u51fa\u300c2222222\u2026..\u300d\u7b49\uff0c\u6709\u4e9b\u624b\u6a5f\u786c\u9ad4\u6c92\u6709\u652f\u63f4\u52a0\u901f\u5668\uff0c\u5c31\u4e0d\u6703\u9001\u51fa\u4efb\u4f55\u8cc7\u6599\uff0c\u8207\u4e0a\u9762\u76f8\u540c\u7684\uff0c\u6211\u5011\u7a0b\u5f0f\u4ee5\u5b57\u4e32\u6bd4\u5c0d\uff0c\u6240\u4ee5\u9019\u500b\u529f\u80fd\u7121\u6cd5\u63a7\u5236\u71c8\u865f\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928092-348097653.png?resize=286%2C381&#038;ssl=1\" alt=\"\" width=\"286\" height=\"381\"\/><figcaption class=\"wp-element-caption\">\u571618\uff1a\u52a0\u901f\u5668\u529f\u80fd<br>\uff08\u8acb\u900f\u904e\u50be\u659c\u4f60\u7684\u624b\u6a5f\u4f86\u89f8\u767c\uff09<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928095-4148297311.png?resize=359%2C369&#038;ssl=1\" alt=\"\" width=\"359\" height=\"369\"\/><figcaption class=\"wp-element-caption\">\u571619\uff1a\u63a5\u6536\u5230\u7684\u8cc7\u6599<\/figcaption><\/figure>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-0\">\u6309\u9215\u63a7\u5236\u529f\u80fd<\/h3>\n\n\n\n<p>\u6309\u9215\u7684\u529f\u80fd\u5982\u5716\u793a\uff0c\u4e0d\u904e\u9019\u88e1APP\u6709\u4e00\u500b\u5c0fbug\uff0c\u5c31\u662f5\u30016\u662f\u6a19\u932f\u7684\uff0c\u9810\u8a2d\u6a19\u62104\u30014\uff08\u5982\u571620\uff09\uff0c\u6211\u5011\u8981\u9032\u5165\u8a2d\u5b9a\u9032\u884c\u4fee\u6539\u3002<br>\u9ede\u9078\u53f3\u4e0a\u6a5f\u5668\u4eba\u5716\u793a\u6309\u9215\u9032\u5165\u8a2d\u5b9a\u529f\u80fd\uff0c\u5c0b\u627e\u300cCommand button configuration\u300d\uff08\u5982\u571621\uff09\uff0c\u9ede\u9078Button E\uff0c\u7136\u5f8c\u4fee\u6539\u5c0d\u61c9\u7684\u503c\u5f9e4\u6539\u70ba5\uff0c\u76f8\u540c\u7684\u6b65\u9a5f\uff0c\u8acb\u8a2d\u5b9aButton F\u5c0d\u61c9\u7684\u503c\u70ba6\u3002\u5b8c\u6210\u4fee\u6539\u8a2d\u5b9a\u4e4b\u5f8c\uff0c\u4e00\u6a23\u4f9d\u5e8f\u9ede\u9078\u6309\u9215\uff0c\u4e5f\u53ef\u4ee5\u89c0\u5bdf\u5230\u71c8\u865f\u7684\u8b8a\u5316<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928153-3999900695.png?resize=282%2C424&#038;ssl=1\" alt=\"\" width=\"282\" height=\"424\"\/><figcaption class=\"wp-element-caption\">\u571620\uff1a\u6309\u9215\u7684\u529f\u80fd<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928156-2451419300.png?resize=280%2C423&#038;ssl=1\" alt=\"\" width=\"280\" height=\"423\"\/><figcaption class=\"wp-element-caption\">\u571621\uff1a\u8a2d\u5b9aButton E\u6309\u9215\u70ba5<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928161-3386879270.png?resize=281%2C396&#038;ssl=1\" alt=\"\" width=\"281\" height=\"396\"\/><figcaption class=\"wp-element-caption\">\u571622\uff1a\u8a2d\u5b9aButton F\u6309\u9215\u70ba6<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928164-1556899810.png?resize=282%2C406&#038;ssl=1\" alt=\"\" width=\"282\" height=\"406\"\/><figcaption class=\"wp-element-caption\">\u571623\uff1a\u6b63\u78ba\u7684\u6309\u9215\u529f\u80fd<\/figcaption><\/figure>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"htoc-11111\">\u8a9e\u97f3\u6307\u4ee4\u529f\u80fd<\/h3>\n\n\n\n<p>\u6700\u5f8c\u6211\u5011\u4f86\u770b\u53f3\u4e0b\u89d2\u7684\u529f\u80fd\u8a9e\u97f3\u6307\u4ee4\uff08Voice Control\uff09\uff0c\u4e5f\u5c31\u662f\u900f\u904e\u8a9e\u97f3\u8fa8\u8b58\u4f86\u63a7\u5236\u50b3\u8f38\u7684\uff0c\u4e0d\u904e\u6211\u5011\u4e00\u6a23\u5fc5\u9808\u5148\u8a2d\u5b9a\u8a9e\u97f3\u53ca\u6240\u5c0d\u61c9\u7684\u6587\u5b57\uff0c\u4f8b\u5982\uff0c\u7576\u6211\u5011\u8aaa\u300c\u958b\u7da0\u71c8\u300d\uff0c\u624b\u6a5f\u5c31\u9001\u51fa\u300c1\u300d\u5230ESP32\uff0c\u800c\u6839\u64da\u5224\u65b7ESP32\u7372\u5f971\u5c31\u6703\u958b\u555f\u7da0\u8272LED\u3002<br>\u6211\u5011\u5148\u9ede\u9078\u53f3\u4e0a\u89d2\u7684\u6a5f\u5668\u4eba\u5716\u793a\u4f86\u8a2d\u5b9a\u8a9e\u97f3\u6307\u4ee4\uff0c\u9032\u5165\u8a2d\u5b9a\u5f8c\u5f80\u4e0b\u62c9\u5230\u5e95\uff0c\u53ef\u4ee5\u627e\u5230\u300cVocal Command Configuration\u300d\u7684\u529f\u80fd\uff08\u5982\u571624\uff09\uff0c\u9032\u5165\u8a2d\u5b9a\u756b\u9762\u5f8c\uff0c\u8a72APP\u4e00\u5171\u63d0\u4f9b10\u500b\u8a9e\u97f3\u6307\u4ee4\uff08\u5982\u571625\uff09\uff0c\u6211\u5011\u5148\u8a2d\u5b9a\u4e00\u500b\u4f5c\u70ba\u793a\u7bc4\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928245-616149958.png?resize=258%2C434&#038;ssl=1\" alt=\"\" width=\"258\" height=\"434\"\/><figcaption class=\"wp-element-caption\">\u571624\uff1a\u8a2d\u5b9a\u8a9e\u97f3\u6307\u4ee4<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928249-1524423863.png?w=1290&#038;ssl=1\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u571625\uff1a\u4e00\u5171\u670910\u7d44\u8a9e\u97f3\u6307\u4ee4<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u8a2d\u5b9a\u65b9\u5f0f\u5982\u4e0b\uff0c\u6211\u5011\u9ede\u9078\u7b2c\u4e00\u500b\u8a9e\u97f3\u6307\u4ee4\u300cVocal Command no1\u300d\u5f8c\uff0c\u4e00\u5171\u6709\u5169\u500b\u503c\u8981\u8a2d\u5b9a\uff0c\u7b2c\u4e00\u500bVocal command\u4ee3\u8868\u8981\u8b1b\u7684\u8a71\uff0c\u7b2c\u4e8c\u500bData to send\u5247\u662f\u8981\u5728\u85cd\u82bd\u767c\u9001\u7684\u6587\u5b57\uff0c\u8209\u4f8b\u4f86\u8aaa\uff0c\u8981\u8b1b\u7684\u8a71\u5c31\u662f\u300c\u958b\u7da0\u71c8\u300d\uff08\u5982\u571626\uff09\uff0c\u800c\u8981\u5728\u85cd\u82bd\u767c\u9001\u7684\u6587\u5b57\u5247\u662f\u300c1\u300d\uff08\u5982\u571627\uff09\u3002<br><br>\u9019\u6a23\u7576\u624b\u6a5f\u807d\u5230\u6211\u5011\u8b1b\u300c\u958b\u7da0\u71c8\u300d\u6642\uff0c\u5c31\u6703\u767c\u90011\u5230ESP32\uff0c\u800c\u4f9d\u64da\u7a0b\u5f0f\u7684\u5224\u65b7\uff0c\u6536\u52301\u5c31\u6703\u958b\u555f\u7da0\u71c8\u3002\u800c\u5176\u9918\u7684\u8a9e\u97f3\u6307\u4ee4\u5247\u53ef\u4ee5\u4f9d\u7167\u76f8\u540c\u7684\u65b9\u5f0f\u8a2d\u5b9a\uff0c\u4f8b\u5982\u300cVocal Command no2\u300d\u7684Vocal command\u8a2d\u5b9a\u70ba\u300c\u95dc\u7da0\u71c8\u300d\u3001Data to send\u8a2d\u5b9a\u70ba\u300c2\u300d\uff0c\u800c\u300cVocal Command no3\u300d\u7684Vocal command\u8a2d\u5b9a\u70ba\u300c\u958b\u9ec3\u71c8\u300d\u3001Data to send\u8a2d\u5b9a\u70ba\u300c3\u300d\u7b49\u7b49\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928319-1128939285.png?resize=288%2C406&#038;ssl=1\" alt=\"\" width=\"288\" height=\"406\"\/><figcaption class=\"wp-element-caption\">\u571626\uff1a\u8a2d\u5b9a\u8a9e\u97f3\u547d\u4ee4\u70ba\u300c\u958b\u7da0\u71c8\u300d<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928322-2734775506.png?resize=286%2C403&#038;ssl=1\" alt=\"\" width=\"286\" height=\"403\"\/><figcaption class=\"wp-element-caption\">\u571627\uff1a\u8a2d\u5b9a\u8981\u9001\u51fa\u7684\u6587\u5b57\u300c1\u300d<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u63a5\u4e0b\u4f86\u6211\u5011\u5c31\u53ef\u4ee5\u5229\u7528\u624b\u6a5f\u8a9e\u97f3\u8fa8\u8b58\u7684\u529f\u80fd\uff0c\u4f86\u63a7\u5236\u71c8\u865f\u958b\u95dc\uff0c\u56de\u5230APP\u9996\u9801\u756b\u9762\u5f8c\uff08\u5982\u571628\uff09\uff0c\u9ede\u9078\u53f3\u4e0b\u89d2\u7684\u300cVoice Control\u300d\u8a9e\u97f3\u6309\u9215\u5c31\u6703\u8df3\u51fa\u9ea5\u514b\u98a8\u5716\u793a\uff08\u5982\u571629\uff09\uff0c\u9ede\u9078\u9ea5\u514b\u98a8\u5f8c\uff0c\u8acb\u8b80\u8005\u8aaa\u51fa\u8a2d\u5b9a\u597d\u7684\u8a9e\u97f3\u6307\u4ee4\uff0c\u4f8b\u5982\u300c\u958b\u7da0\u71c8\u300d\uff0c\u6b64\u6642\u624b\u6a5f\u8fa8\u8b58\u300c\u958b\u7da0\u71c8\u300d\u6210\u529f\u5f8c\uff08\u5982\u571630\uff09\uff0c\u5c31\u6703\u5728\u85cd\u82bd\u9001\u51fa\u300c1\u300d\u7d66ESP32\uff0cESP32\u5c31\u53ef\u4ee5\u958b\u555f\u7da0\u71c8\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928376-2397614973.png?resize=308%2C420&#038;ssl=1\" alt=\"\" width=\"308\" height=\"420\"\/><figcaption class=\"wp-element-caption\">\u571628\uff1a\u9ede\u9078\u53f3\u4e0b\u89d2\u7684Voice Control<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928380-1248096289.png?resize=308%2C417&#038;ssl=1\" alt=\"\" width=\"308\" height=\"417\"\/><figcaption class=\"wp-element-caption\">\u571629\uff1a\u9ede\u9078\u9ea5\u514b\u98a8\u5716\u793a<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928385-3344755122.png?resize=308%2C471&#038;ssl=1\" alt=\"\" width=\"308\" height=\"471\"\/><figcaption class=\"wp-element-caption\">\u571630\uff1a\u300c\u958b\u7da0\u71c8\u300d\u8fa8\u8b58\u6210\u529f<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1585928393-161031262.png?resize=315%2C343&#038;ssl=1\" alt=\"\" width=\"315\" height=\"343\"\/><figcaption class=\"wp-element-caption\">\u571631\uff1aESP32\u5f9e\u85cd\u82bd\u6536\u5230\u300c1\u300d<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>\u672c\u7df4\u7fd2\u53ea\u7528\u4f86\u958b\u555f\u6216\u95dc\u9589LED\uff0c\u7576\u7136\u6709\u9ede\u5927\u6750\u5c0f\u7528\uff0c\u4f46\u662f\u8b80\u8005\u53ef\u4ee5\u81ea\u884c\u958b\u767c\u65b0\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u900f\u904e\u7e7c\u96fb\u5668relay\u4f86\u958b\u555f\u6216\u95dc\u9589\u96fb\u98a8\u6247\u3001\u6aaf\u71c8\u3001\u751a\u81f3\u51b7\u6c23\u7b49\u7b49\u7684\u5bb6\u96fb\uff0c\u800c\u9054\u5230\u7c21\u6613\u7684\u667a\u6167\u5bb6\u96fb\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n<p>\u53c3\u8003\u672c\u4eba\u4e4b\u524d\u7684\u4f5c\u54c1\u5982\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Arduino Bluetooth Control by Android Phone\" width=\"1290\" height=\"726\" src=\"https:\/\/www.youtube.com\/embed\/hUC-MHM_P04?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"quote\">PS.\u672c\u7df4\u7fd2\u5176\u5be6\u53ea\u6709\u7528\u5230ESP32 \u85cd\u82bd2.0 Serial Port Profile(SSP)\u901a\u8a0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7ae0\u5c07\u4ecb\u7d39ESP32\u7684\u85cd\u82bd\u901a\u8a0a\uff0c\u85cd\u82bd\u8207WiFi\u90fd\u662f\u7528\u4f86\u901a\u8a0a\uff0c\u85cd\u82bd\u901a\u5e38\u7528\u65bc\u8fd1\u7aef\u9ede\u5c0d\u9ede\u901a\u8a0a\uff0cWiFi\u5247\u5e38\u7528\u4f86\u9023\u5165\u7db2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,29],"tags":[],"class_list":["post-628","post","type-post","status-publish","format-standard","hentry","category-esp32","category-esp32-started"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/comments?post=628"}],"version-history":[{"count":4,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"predecessor-version":[{"id":930,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/628\/revisions\/930"}],"wp:attachment":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}