{"id":9727,"date":"2021-06-25T00:00:12","date_gmt":"2021-06-24T15:00:12","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=9727"},"modified":"2022-03-07T16:18:00","modified_gmt":"2022-03-07T08:18:00","slug":"%e4%bd%bf%e7%94%a8esp-wroom-02-wifi%e6%a8%a1%e5%9d%97%e4%bd%9c%e4%b8%baarduino-mcu","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/how-tos\/arduino\/using-esp-wroom-02-wifi-module-as-arduino-mcu","title":{"rendered":"\u4f7f\u7528ESP-WROOM-02 Wifi\u6a21\u5757\u4f5c\u4e3aArduino MCU"},"content":{"rendered":"<p><script type=\"text\/javascript\" src=\"https:\/\/ssl-cache.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/t3\/if.js\" charset=\"UTF-8\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/script><\/p>\n<div class=\"\u201cthe_content_wrapper\u201d\">\n<p>\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e<a href=\"https:\/\/www.deviceplus.com\/\">DevicePlus.com<\/a>\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6890\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001-300x169.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001-260x146.jpg 260w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001-50x28.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image001-133x75.jpg 133w\" alt=\"esp-wroom-02\" width=\"700\" height=\"394\" \/><\/p>\n<h2><b>\u4f7f\u7528 ESP-<a href=\"https:\/\/www.deviceplus.com\/arduino\/lets-play-with-esp-wroom-32-on-arduino-environment-construction-setup-led-blinking\/\">WROOM<\/a>-02 Wifi \u6a21\u5757\u4f5c\u4e3a Arduino MCU<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u5728ESP-WROOM-02\u4e0a\u5199\u5165Arduino\u7a0b\u5e8f\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528wifi\u6a21\u5757\u4f5c\u4e3aArduino MCU\u3002\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u4f7f\u7528ESP-WROOM-02\u5f00\u53d1\u677f\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5bf9\u4e4b\u524d\u7684\u88c5\u7f6e\u4e2d\u6240\u4ecb\u7ecd\u7684ESP \u2013 WROOM \u2013 02\u8fdb\u884c\u6d4b\u8bd5\u4e86\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u672c\u6b21\u7535\u5b50\u8bbe\u5907\u6e05\u5355<\/b><\/h2>\n<p><b>\u9884\u8ba1\u5b8c\u6210\u65f6\u95f4\uff1a60\u5206\u949f<\/b><\/p>\n<p><b>\u6240\u9700\u90e8\u4ef6\uff1a<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u2022 ESP-WROOM-02 \u5f00\u53d1\u677f<\/span><a href=\"https:\/\/www.ebay.com\/p\/Esp-wroom-02-Development-Board-WeMos-D1-NodeMCU-WiFi-Internet-for-Arduino\/776098964\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">1<\/span><\/a><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\">,<\/span><a href=\"https:\/\/international.switch-science.com\/catalog\/2500\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">3<\/span><\/a><span style=\"font-weight: 400;\">,\u7b49<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u2022 \u9762\u5305\u677f<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u2022 LED (3 mm \u7eff\u8272) <\/span><a href=\"https:\/\/www.sparkfun.com\/products\/9650\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">1<\/span><\/a><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\">,<\/span><a href=\"https:\/\/www.ebay.com\/itm\/100PCS-Diffused-LED-3MM-GREEN-COLOR-GREEN-LIGHT-Super-Bright-CA-NEW\/141976472523?hash=item210e750bcb:g:4mQAAOSwMKpUafbN\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">3<\/span><\/a><span style=\"font-weight: 400;\">,\u7b49<\/span><\/li>\n<li style=\"font-weight: 400;\">\u2022 <a href=\"https:\/\/www.amazon.com\/Projects-100EP512220R-220-Resistors-Pack\/dp\/B0185FID0K\/ref=sr_1_1?s=industrial&amp;ie=UTF8&amp;qid=1514694536&amp;sr=1-1&amp;keywords=resistor+220+ohm\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">\u7535\u963b\u5668 220 \u03a9<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\">\u2022 <a href=\"https:\/\/www.adafruit.com\/product\/161\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">CdS \u5149\u5b66\u4f20\u611f\u5668<\/span><\/a><span style=\"font-weight: 400;\"> (5 mm)<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><b>\u4e0b\u8f7d Arduino IDE<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u9996\u5148\uff0c\u4e3a\u4e86\u5c06ESP-WROOM-02\u7528\u4f5cArduino\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u4f7f\u7528\u7684\u662fArduino IDE\u7684\u6b63\u786e\u7248\u672c\u3002Arduino IDE\u8fc7\u53bb\u66fe\u5728\u4e24\u4e2a\u4e0d\u540c\u7684\u7f51\u7ad9\u88ab\u53d1\u5e03\u8fc7\uff1aarduino.cc \u4ee5\u53caarduino.org\u3002\u8981\u4f7f\u7528ESP-WROOM-02\uff0c\u8bf7\u5b89\u88c5arduino.cc\u6240\u53d1\u5e03\u7684Arduino IDE\u3002\uff08\u73b0\u5728\u8fd9\u4e24\u4e2a\u7f51\u7ad9\u5df2\u7ecf\u5408\u5e76\u5728\u4e00\u8d77\u4e86\uff0c\u56e0\u6b64\u5f53\u60a8\u8bbf\u95eearduino.org\u65f6\uff0c\u5c06\u4f1a\u88ab\u91cd\u5b9a\u5411\u5230arduino.cc\u3002\uff09<\/span><\/p>\n<div id=\"attachment_6891\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6891\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002-300x171.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002-257x146.jpg 257w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002-50x28.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image002-132x75.jpg 132w\" alt=\"esp-wroom-02\" width=\"700\" height=\"398\" aria-describedby=\"caption-attachment-6891\" \/><\/p>\n<p id=\"caption-attachment-6891\" class=\"wp-caption-text\">\u56fe1\uff1aarduino.cc\u4e0a\u7684Arduino IDE\u4e0b\u8f7d\u9875\u9762<\/p>\n<\/div>\n<h2><b>\u5728Arduino\u4e0a\u6dfb\u52a0ESP-WROOM-02<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u8981\u5c06ESP-WROOM-02\u7528\u4f5cArduino\uff0c\u60a8\u9700\u8981\u5c06ESP-WROOM-02\u677f\u6dfb\u52a0\u5230Arduino IDE\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u5c06ESP-WROOM-02\u6dfb\u52a0\u5230Arduino IDE\uff1a<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400;\">1. \u542f\u52a8Arduino IDE<\/span><\/li>\n<li><span style=\"font-weight: 400;\">2. \u6253\u5f00 \u201c\u6587\u4ef6\uff08File\uff09\u201d \u2192 \u201c\u9996\u9009\u9879\uff08Preferences\uff09\u201d<\/span><\/li>\n<li><span style=\"font-weight: 400;\">3. \u5728\u201c\u9996\u9009\u9879\u201d\u4e0b\u7684\u201c\u9644\u52a0\u5f00\u53d1\u677f\u7ba1\u7406\u5668\u7f51\u5740\uff08Additional Boards Manager URLs\uff09\u201d\u4e2d\u8f93\u5165\u4ee5\u4e0b\u7f51\u5740\uff1a<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">URL: <\/span><b>http: \/\/arduino.esp8266.com\/stable\/<a href=\"https:\/\/www.deviceplus.com\/arduino\/how-to-make-smart-home-electronics-a-smart-mailbox\/\">package_esp8266com_index.json<\/a><\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u5206\u5e03\u5f0f\u7ec4\u4ef6\uff1ahttps: \/\/github.com\/esp8266\/Arduino<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u8fd9\u662f\u4e00\u4e2a\u7ba1\u7406\u5458\u8d26\u6237\u7684\u7ba1\u7406\u5668\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8be5\u529f\u80fd\u8f93\u5165\u63cf\u8ff0\u5f00\u53d1\u677f\u4fe1\u606f\u7684\u7f51\u5740\uff0c\u4ece\u800c\u5c06\u65b0\u7684\u5f00\u53d1\u677f\u6dfb\u52a0\u5230Arduino\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6892\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6892\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003-300x249.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003-176x146.jpg 176w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003-50x42.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image003-90x75.jpg 90w\" alt=\"esp-wroom-02\" width=\"700\" height=\"582\" aria-describedby=\"caption-attachment-6892\" \/><\/p>\n<p id=\"caption-attachment-6892\" class=\"wp-caption-text\">\u56fe2\uff1aArduino IDE\u9996\u9009\u9879\u9875\u9762<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<ol start=\"4\">\n<li><span style=\"font-weight: 400;\">4. \u8f93\u5165\u7f51\u5740\u540e\uff0c\u5355\u51fb\u201c\u9996\u9009\u9879\u201d\u5c4f\u5e55\u53f3\u4e0b\u89d2\u7684\u201c\u786e\u5b9a\uff08OK\uff09\u201d\uff0c\u7136\u540e\u5c06\u5176\u5173\u95ed\u3002\u63a5\u4e0b\u6765\uff0c\u9009\u62e9\u201c\u5de5\u5177\uff08Tools\uff09\u201d \u2192\u201c\u5f00\u53d1\u677f\uff08Board\uff09\u201d \u2192\u201c\u5f00\u53d1\u677f\u7ba1\u7406\u5668\uff08Boards Manager\uff09\u201d\u3002<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6893\" class=\"wp-caption alignnone\" style=\"width: 709px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6893\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004.jpg\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004.jpg 699w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004-300x219.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004-200x146.jpg 200w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004-50x37.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image004-103x75.jpg 103w\" alt=\"esp-wroom-02\" width=\"699\" height=\"511\" aria-describedby=\"caption-attachment-6893\" \/><\/p>\n<p id=\"caption-attachment-6893\" class=\"wp-caption-text\">\u56fe3\uff1a\u201c\u5de5\u5177\uff08Tools\uff09\u201d \u2192\u201c\u5f00\u53d1\u677f\uff08Board\uff09\u201d \u2192\u201c\u5f00\u53d1\u677f\u7ba1\u7406\u5668\uff08Boards Manager\uff09\u201d<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<ol start=\"5\">\n<li><span style=\"font-weight: 400;\">5. \u5f00\u53d1\u677f\u7ba1\u7406\u5668\u9875\u9762\u51fa\u73b0\u65f6\uff0c\u5728\u641c\u7d22\u5b57\u6bb5\u4e2d\u8f93\u5165\u201cESP 82\u201d\u3002\u5b83\u5c06\u663e\u793a\u4e3a\u201cESP8266\u201d\u3002\u8be5ESP8266\u5373\u662f\u4e0eESP-WROOM-02\u76f8\u5bf9\u5e94\u7684\u5f00\u53d1\u677f\uff0c\u56e0\u6b64\u70b9\u51fb\u201c\u5b89\u88c5\uff08Install\uff09\u201d\u6765\u6dfb\u52a0\u5f00\u53d1\u677f\u3002<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6894\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6894\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005-300x169.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005-260x146.jpg 260w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005-50x28.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image005-133x75.jpg 133w\" alt=\"esp-wroom-02\" width=\"700\" height=\"394\" aria-describedby=\"caption-attachment-6894\" \/><\/p>\n<p id=\"caption-attachment-6894\" class=\"wp-caption-text\">\u56fe4\uff1a\u5f00\u53d1\u677f\u7ba1\u7406\u5668\u9875\u9762<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<ol start=\"6\">\n<li><span style=\"font-weight: 400;\">6. \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u91cd\u542fArduino\uff0c\u7136\u540e\u518d\u6b21\u6253\u5f00\u201c\u5de5\u5177\u201d\u2192\u201c\u5f00\u53d1\u677f\u201d\u3002\u5982\u679c\u60a8\u770b\u5230\u4e00\u7ec4\u4e0eESP8266\u76f8\u5173\u7684\u5f00\u53d1\u677f\uff0c\u90a3\u5c31\u8bc1\u660e\u6210\u529f\u4e86\uff01<\/span><\/li>\n<\/ol>\n<div id=\"attachment_6895\" class=\"wp-caption alignnone\" style=\"width: 651px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6895\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006.jpg\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006.jpg 641w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006-284x300.jpg 284w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006-138x146.jpg 138w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006-47x50.jpg 47w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image006-71x75.jpg 71w\" alt=\"esp-wroom-02\" width=\"641\" height=\"676\" aria-describedby=\"caption-attachment-6895\" \/><\/p>\n<p id=\"caption-attachment-6895\" class=\"wp-caption-text\">\u56fe5\uff1a\u6dfb\u52a0ESP8266<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u73b0\u5728\u51c6\u5907\u5de5\u4f5c\u5df2\u7ecf\u5b8c\u6210\uff0c\u8ba9\u6211\u4eec\u6765\u5199\u5165\u4e00\u4e2aArduino\u7a0b\u5e8f\u5427\uff01<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u5c06\u7a0b\u5e8f\u5199\u5165 ESP-WROOM-02<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u6211\u4eec\u53ef\u4ee5\u7528\u4e0e\u4e00\u822cArduino\u76f8\u540c\u7684\u6b65\u9aa4\u6765\u5199\u5165\u7a0b\u5e8f\u3002\u9996\u5148\uff0c\u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u7a0b\u5e8f\u6765\u5bf9LED\u8fdb\u884c\u6d4b\u8bd5\u3002\u5c06\u8f93\u51fa\u8bbe\u7f6e\u4e3aESP-WROOM-02\u4e0a\u7684\u5f15\u811a13\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6896\" class=\"wp-caption alignnone\" style=\"width: 317px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6896\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007.jpg\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007.jpg 307w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007-300x243.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007-180x146.jpg 180w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007-50x41.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image007-92x75.jpg 92w\" alt=\"esp-wroom-02\" width=\"307\" height=\"249\" aria-describedby=\"caption-attachment-6896\" \/><\/p>\n<p id=\"caption-attachment-6896\" class=\"wp-caption-text\">\u56fe6\uff1a\u7528\u4e8eESP-WROOM-02\u6d4b\u8bd5\u7684LED\u7535\u8def<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>void setup() {\r\npinMode(13, OUTPUT);\r\n}\r\n \r\nvoid loop() {\r\ndigitalWrite(13, HIGH);\r\ndelay(400);\r\ndigitalWrite(13, LOW);\r\ndelay(400);\r\n}\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><script type=\"text\/javascript\">\n\tjstream_t3.PlayerFactoryIF.create({\n\tb:\"eqa194obdo.eq.webcdn.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/\",\n\tc:\"NDc3\",\n\tm:\"MTExMw==\",\n\ts:{\n\t\thp:360,\n\t\til:\"off\",\n\t\trb:\"off\",\n\t\tsn:\"f,t,g\",\n\t\twp:640\n\t}});\n<\/script><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">LED \u95ea\u70c1\u4e86\uff01<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>ESP-WROOM-02\u7684\u6a21\u62df\u8f93\u5165<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u6240\u4ee5\uff0c\u6211\u4eec\u6210\u529f\u4f7fLED\u4eae\u8d77\u4e86\u3002\u63a5\u4e0b\u6765\u67e5\u770b\u4e00\u4e0b\u5176\u4ed6\u7a0b\u5e8f\u3002\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5176wifi\u901a\u4fe1\u529f\u80fd\u6765\u5b9e\u73b0\u591a\u79cd\u5e94\u7528\uff0c\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u53ef\u4ee5\u8fdc\u7a0b\u83b7\u53d6\u6570\u636e\u7684\u8bbe\u5907\uff0c\u4ee5\u5b9e\u73b0\u8fdc\u7a0b\u64cd\u63a7\uff0c\u5c31\u50cf\u6c7d\u8f66\u4e0a\u7684\u65e0\u7ebf\u7535\u63a7\u5236\u90a3\u6837\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u6211\u4eec\u5148\u6765\u5904\u7406\u6765\u81ea\u5149\u5b66\u4f20\u611f\u5668\u7684\u8f93\u5165\u3002\u5728Arduino UNO\u4e0a\u6709\u6a21\u62df\u8f93\u5165\u5f15\u811aA0-A4\uff0c\u4f46\u662fESP-WROOM-02\u6ca1\u6709\u50cfA0-A4\u8fd9\u6837\u7684\u6a21\u62df\u8f93\u5165\u5f15\u811a\u3002\u5e76\u4e14\u6ca1\u6709\u6570\u5b57\u5f15\u811a1\uff0c3-4\uff0c\u4ee5\u53ca 6-11\u3002\u8fd9\u4e9b\u5f15\u811a\u662f\u65e0\u6cd5\u4f7f\u7528\u7684\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u5f15\u811a\u901a\u5e38\u88ab\u7528\u4e8e\u6267\u884cESP-WROOM-02\u7684\u4e00\u4e9b\u6807\u51c6\u529f\u80fd\uff0c\u5982wifi\u901a\u4fe1\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ESP-WROOM-02\u4f3c\u4e4e\u5e76\u6ca1\u6709analogRead\u51fd\u6570\uff0c\u6240\u4ee5\u65e0\u6cd5\u4f7f\u7528\u8be5\u529f\u80fd\u3002\u90a3\u4e48\uff0c\u6211\u4eec\u5982\u4f55\u6765\u8fdb\u884c\u6a21\u62df\u8f93\u5165\u5462\uff1f\u6211\u4eec\u4e5f\u8bb8\u53ef\u4ee5<\/span><b>\u4f7f\u7528TOUT\u5f15\u811a\u4e0a\u7684 \u201csystem_adc_read ()\u201d\u51fd\u6570\u6765\u83b7\u53d6\u6a21\u62df\u503c<\/b><span style=\"font-weight: 400;\">\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6897\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6897\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009-300x197.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009-223x146.jpg 223w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009-50x33.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image009-114x75.jpg 114w\" alt=\"esp-wroom-02\" width=\"700\" height=\"459\" aria-describedby=\"caption-attachment-6897\" \/><\/p>\n<p id=\"caption-attachment-6897\" class=\"wp-caption-text\">\u56fe7\uff1aTOUT\u5f15\u811a<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u4f46\u662f\uff0c\u8fd9\u4e0e\u4e00\u822c\u7684Arduino\u6a21\u62df\u5f15\u811a\u7565\u6709\u4e0d\u540c\u3002TOUT\u5f15\u811a\u53ef\u4ee5\u68c0\u6d4b\u51fa0V\u81f31V\u4e4b\u95f4\u7684\u8f93\u5165\u503c\uff0c\u4f46\u662f\u5982\u679c\u76f4\u63a5\u5411TOUT\u5f15\u811a\u8f93\u51653.3V\u7684\u503c\u53ef\u80fd\u4f1a\u635f\u574f\u7535\u8def\u3002\u800c\u5f53\u6dfb\u52a0\u4e00\u4e2a\u5149\u5b66\u4f20\u611f\u5668\u65f6\uff0c\u7535\u6e90\u7535\u538b\u4e3a3.3V\uff0c\u56e0\u6b64\u5fc5\u987b\u8fdb\u884c\u8c03\u6574\uff0c\u4ee5\u4f7f\u8f93\u5165TOUT\u7684\u6700\u5927\u7535\u538b\u503c\u4e3a1V\u3002\u6211\u4eec\u5c06\u4f7f\u7528\u51e0\u4e2a\u7535\u963b\u5668\u6765\u521b\u5efa\u4e00\u4e2a\u5206\u538b\u5668\u7535\u8def\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6898\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6898\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010-300x169.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010-260x146.jpg 260w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010-50x28.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image010-133x75.jpg 133w\" alt=\"esp-wroom-02\" width=\"700\" height=\"394\" aria-describedby=\"caption-attachment-6898\" \/><\/p>\n<p id=\"caption-attachment-6898\" class=\"wp-caption-text\">\u56fe8\uff1a\u6240\u6dfb\u52a0\u7684\u5149\u5b66\u4f20\u611f\u5668<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6899\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6899\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011-300x169.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011-260x146.jpg 260w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011-50x28.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image011-133x75.jpg 133w\" alt=\"esp-wroom-02\" width=\"700\" height=\"394\" aria-describedby=\"caption-attachment-6899\" \/><\/p>\n<p id=\"caption-attachment-6899\" class=\"wp-caption-text\">\u56fe9\uff1a\u7535\u538b\u8f93\u51fa\u4e3a1V<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><b>ESP-WROOM-02\uff1a\u7528\u4e8e\u83b7\u53d6\u5149\u5b66\u4f20\u611f\u5668\u503c\u7684\u7a0b\u5e8f<\/b><\/p>\n<p>&nbsp;<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>\/\/necessary for analog input with ESP-WROOM-02\r\nextern \"C\" {\r\n#include \"user_interface.h\"\r\n}\r\n \r\nvoid setup() {\r\n Serial.begin(115200); \/\/also different from ordinary Arduino\r\n pinMode(13, OUTPUT);\r\n}\r\n \r\n\/\/obtain input value from TOUT pin\r\nint getToutValue(){\r\n int res = system_adc_read(); \/\/get the TOUT value here\r\n return res;\r\n}\r\n \r\nvoid loop() {\r\n int val= getToutValue();\r\n Serial.print(\"value:\");\r\n Serial.println(val);\r\n \r\n if(val &amp;gt; 580){\r\n digitalWrite(13, HIGH);\r\n delay(400);\r\n }\r\n else{\r\n digitalWrite(13, LOW);\r\n delay(400);\r\n }\r\n}\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u5149\u5b66\u4f20\u611f\u5668\u7684\u503c\u5c06\u8f93\u51fa\u5230\u4e32\u884c\u76d1\u89c6\u5668\u3002<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6900\" class=\"wp-caption alignnone\" style=\"width: 710px;\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6900\" src=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012.jpg\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" srcset=\"https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012.jpg 700w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012-300x151.jpg 300w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012-260x131.jpg 260w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012-50x25.jpg 50w, https:\/\/www.deviceplus.com\/wp-content\/uploads\/2018\/01\/image012-150x75.jpg 150w\" alt=\"esp-wroom-02\" width=\"700\" height=\"353\" aria-describedby=\"caption-attachment-6900\" \/><\/p>\n<p id=\"caption-attachment-6900\" class=\"wp-caption-text\">\u56fe10\uff1a\u4e32\u884c\u76d1\u89c6\u5668\u4e2d\u663e\u793a\u7684\u503c<\/p>\n<\/div>\n<h2><\/h2>\n<h2><b>analogWrite \u51fd\u6570<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0canalogRead\u51fd\u6570\u662f\u6ca1\u6709\u7528\u7684\uff0c\u90a3\u4e48analogWrite\u53c8\u5982\u4f55\u5462\uff1fArduino UNO\u5177\u6709\u4e00\u4e2a\u50cf\u6a21\u62df\u5f15\u811a\u90a3\u6837\u53ef\u4ee5\u8f93\u51fa\u6a21\u62df\u503c\u7684\u5f15\u811a\u3002\u90a3\u4e48ESP-WROOM-02\u5462\uff1f\u6211\u4eec\u6765\u8fd0\u884c\u4ee5\u4e0b\u7a0b\u5e8f\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>ESP-WROOM-02\uff1a\u7528\u4e8e\u83b7\u53d6\u5149\u5b66\u4f20\u611f\u5668\u503c\u7684\u7a0b\u5e8f<\/b><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>void setup() {\r\n pinMode(13, OUTPUT);\r\n}\r\n \r\nvoid loop() {\r\n for(int i=0;i&amp;lt;256;i++){\r\n analogWrite(13, i);\r\n delay(40);\r\n }\r\n}\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><script type=\"text\/javascript\">\n\tjstream_t3.PlayerFactoryIF.create({\n\tb:\"eqa194obdo.eq.webcdn.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/\",\n\tc:\"NDc3\",\n\tm:\"MTExMg==\",\n\ts:{\n\t\thp:360,\n\t\til:\"off\",\n\t\trb:\"off\",\n\t\tsn:\"f,t,g\",\n\t\twp:640\n\t}});\n<\/script><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u5982\u4e0a\u9762\u7684\u89c6\u9891\u6240\u793a\uff0c\u6211\u4eec\u53ef\u4ee5\u63a7\u5236LED\u7684\u4eae\u5ea6\u3002LED\u9010\u6e10\u53d8\u4eae\u53c8\u9010\u6e10\u53d8\u6697\u3002\u7531\u6b64\u53ef\u89c1\uff0c\u6211\u4eec\u786e\u5b9e\u53ef\u4ee5\u4f7f\u7528analogWrite\u51fd\u6570\uff01<\/span><\/p>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/micro.wfjydl.com\/deviceplus\/wp-content\/uploads\/2018\/08\/Device-Plus-logo-for-author-info-75x75.png\" alt=\"DevicePlus \u7f16\u8f91\u56e2\u961f\" width=\"64\" height=\"64\" \/><\/div>\n<div class=\"desc-wrapper\">\n<h5>DevicePlus \u7f16\u8f91\u56e2\u961f<\/h5>\n<div class=\"desc\">\n<p>\u8bbe\u5907\u5347\u7ea7\u7248\u9002\u7528\u4e8e\u6240\u6709\u70ed\u7231\u7535\u5b50\u548c\u673a\u7535\u4e00\u4f53\u5316\u7684\u4eba\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8eDevicePlus.com\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002 \u4f7f\u7528 ESP-WROOM-02 Wifi \u6a21\u5757\u4f5c\u4e3a Arduino MCU \u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u5728ESP-WROOM-02\u4e0a\u5199\u5165Arduino\u7a0b\u5e8f\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f [&hellip;]","protected":false},"author":3,"featured_media":16102,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1130],"tags":[],"class_list":["post-9727","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/9727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=9727"}],"version-history":[{"count":9,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/9727\/revisions"}],"predecessor-version":[{"id":16788,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/9727\/revisions\/16788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/16102"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=9727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=9727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=9727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}