{"id":7997,"date":"2021-03-15T17:05:23","date_gmt":"2021-03-15T09:05:23","guid":{"rendered":"https:\/\/blog.hoyo.idv.tw\/?p=7997"},"modified":"2021-03-17T08:19:16","modified_gmt":"2021-03-17T00:19:16","slug":"wt32-eth01-micropython-%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=7997","title":{"rendered":"WT32-ETH01 - MicroPython \u958b\u767c\u74b0\u5883"},"content":{"rendered":"<p>--<\/p>\n<h2>\u6e96\u5099\u958b\u767c\u74b0\u5883<\/h2>\n<ul>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/flash-upload-micropython-firmware-esp32-esp8266\/\" target=\"_blank\" rel=\"noopener\">Flash\/Upload MicroPython Firmware to ESP32 and ESP8266<\/a><\/li>\n<li><a href=\"https:\/\/micropython.org\/download\/esp32\/\" target=\"_blank\" rel=\"noopener\">Firmware for Generic ESP32 module<\/a><\/li>\n<\/ul>\n<ol>\n<li>\u5b89\u88dd Python3<\/li>\n<li>\u5b89\u88dd pip<\/li>\n<li>\u4e0b\u8f09 uPyCraft<\/li>\n<li>\u6e2c\u8a66\u4f60\u7684\u7b2c\u4e00\u652f LED \u9583\u720d\u7a0b\u5f0f<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true\">pip install --user --upgrade pip\r\npip install esptool<\/pre>\n<p>\u8003\u616e\u5230\u9700\u8981 LAN \u56e0\u6b64\u4e0b\u8f09\u4e86\u00a0<a href=\"https:\/\/micropython.org\/resources\/firmware\/esp32-idf3-20210202-v1.14.bin\" target=\"_blank\" rel=\"noopener\">esp32-idf3-20210202-v1.14.bin<\/a> \u9019\u500b firmware<\/p>\n<p>--<\/p>\n<h2>\u901a\u8a0a\u6e2c\u8a66\u78ba\u8a8d<\/h2>\n<p>\u53ef\u4ee5\u4f7f\u7528 PuTTY \u9019\u985e\u53ef\u4ee5\u4f7f\u7528 COM \u901a\u8a0a\u8edf\u9ad4\uff0c\u4f7f\u7528 115200<\/p>\n<p><a href=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210316_114406.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-8017\" src=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210316_114406-300x190.png\" alt=\"\" width=\"300\" height=\"190\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210316_114406-300x190.png 300w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210316_114406-474x300.png 474w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210316_114406.png 661w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>--<\/p>\n<h2>Thonny IDE \u958b\u767c\u74b0\u5883<\/h2>\n<ul>\n<li><a style=\"text-decoration-line: underline;\" href=\"https:\/\/randomnerdtutorials.com\/getting-started-micropython-esp32-esp8266\/\" target=\"_blank\" rel=\"noopener\">Getting Started with MicroPython on ESP32 and ESP8266<\/a><\/li>\n<\/ul>\n<p>\u9078\u64c7 Thonny \u4e0d\u9078\u00a0uPyCraft \u662f\u56e0\u70ba\u00a0uPyCraft \u7c21\u55ae\u904e\u982d\u4e86<\/p>\n<p>\u5de5\u5177 \u2192 \u9078\u9805 \u2192 \u76f4\u8b6f\u5668<\/p>\n<p><a href=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_170132.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-8013\" src=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_170132-300x259.png\" alt=\"\" width=\"300\" height=\"259\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_170132-300x259.png 300w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_170132-348x300.png 348w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_170132.png 585w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u5b89\u88dd\u6216\u66f4\u65b0\u97cc\u9ad4<\/p>\n<p><a href=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_165455.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-8012\" src=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_165455-300x273.png\" alt=\"\" width=\"300\" height=\"273\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_165455-300x273.png 300w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_165455-330x300.png 330w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2021\/03\/20210315_165455.png 569w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u71d2\u9304\u6642\u8acb\u53c3\u8003\u300c<a href=\"https:\/\/blog.hoyo.idv.tw\/?p=7954\" target=\"_blank\" rel=\"noopener\">ESP \u2013 ESP-12F &amp; ESP8266 &amp; ESP-32 \u71d2\u9304\u6307\u5357<\/a>\u300d\u5c07 IO0 \u63a5\u5730\uff0cEN \u77ed\u63a5\u5730<\/p>\n<p>--<\/p>\n<h2>LED for WT32 (\u5176\u4ed6\u7684 ESP \u5dee\u5225\u53ea\u5728\u65bc\u9810\u8a2d\u7684LED \u8173\u4f4d\u4e0d\u540c)<\/h2>\n<pre class=\"lang:python decode:true\">from machine import Pin\r\nfrom time import sleep\r\n\r\nled = Pin(5, Pin.OUT)\r\n\r\nwhile True:\r\n  led.value(not led.value())\r\n  sleep(0.5)<\/pre>\n<p>--<\/p>\n<h2>\u53c3\u8003\u8cc7\u6e90<\/h2>\n<ul>\n<li><a class=\"qa-list__title-link\" href=\"https:\/\/ithelp.ithome.com.tw\/users\/20103824\/ironman\/2119\" target=\"_blank\" rel=\"noopener\"> Micropython x ESP H\/W \u4e4b\u4e09\u5341\u500b\u9326\u56ca\u5999\u8a08 <\/a><\/li>\n<\/ul>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"7997\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;2,484&nbsp;total views, &nbsp;1&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>-- \u6e96\u5099\u958b\u767c\u74b0\u5883 Flash...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"7997\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;2,484&nbsp;total views, &nbsp;1&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7997"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7997"}],"version-history":[{"count":9,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7997\/revisions"}],"predecessor-version":[{"id":8018,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7997\/revisions\/8018"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}