{"id":683,"date":"2019-04-22T18:19:24","date_gmt":"2019-04-22T09:19:24","guid":{"rendered":"https:\/\/ahnbk.com\/?p=683"},"modified":"2019-04-22T18:19:25","modified_gmt":"2019-04-22T09:19:25","slug":"micropython-repl-%ec%9d%b4%ea%b2%83%ec%a0%80%ea%b2%83-on-esp32","status":"publish","type":"post","link":"https:\/\/ahnbk.com\/?p=683","title":{"rendered":"MicroPython REPL \uc774\uac83\uc800\uac83 on ESP32"},"content":{"rendered":"\n<ul><li><strong>REPL \uc811\uc18d(?)<\/strong><\/li><\/ul>\n\n\n\n<p>micropython\uc740 \uc790\uccb4\uc801\uc73c\ub85c REPL\uc744 \uc81c\uacf5\ud55c\ub2e4. UART0\ub97c \ud1b5\ud574 PC\uc640 \uc5f0\uacb0\ub418\uba70, \uc774\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc120 \uc2dc\ub9ac\uc5bc\ud1b5\uc2e0 \ud504\ub85c\uadf8\ub7a8(picom, putty \ub4f1)\uc744 \uc0ac\uc6a9\ud558\uac70\ub098, \ud130\ubbf8\ub110\uc5d0\uc11c screen \uba85\ub839 \ub4f1\uc744 \uc774\uc6a9\ud574\uc11c \uc774\uc6a9 \uac00\ub2a5\ud558\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ screen \/dev\/tty.SLAB_USBtoUART 115200<\/code><\/pre>\n\n\n\n<p>\uc811\uc18d \uc885\ub8cc\ub294 ctrl+a, ctrl+\\\ub97c \uc21c\uc11c\ub300\ub85c \ub204\ub978\ub2e4.<\/p>\n\n\n\n<ul><li><strong>REPL\uc5d0\uc11c \uc790\ub3d9\uc644\uc131 \uae30\ub2a5 \uc0ac\uc6a9<\/strong><\/li><\/ul>\n\n\n\n<p>import \ud6c4, \ud639\uc740 \ub0b4\uc7a5 \ud391\uc158\uc744 \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\uc5d0 tab \ud0a4\ub97c \uc774\uc6a9\ud55c \uc790\ub3d9\uc644\uc131 \uae30\ub2a5\uc744 \uc81c\uacf5\ud55c\ub2e4. \uc608\ub97c \ub4e4\uc5b4 machine\uc744 import \ud558\uace0 machine.\uae4c\uc9c0 \uc785\ub825 \ud6c4 tab \ud0a4\ub97c \ub20c\ub7ec\ubcf4\uba74,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>>>> import machine\n>>> \n>>> machine.\n__class__       __name__        ADC             DAC\nDEEPSLEEP       DEEPSLEEP_RESET                 EXT0_WAKE\nEXT1_WAKE       HARD_RESET      I2C             PIN_WAKE\nPWM             PWRON_RESET     Pin             RTC\nSLEEP           SOFT_RESET      SPI             Signal\nTIMER_WAKE      TOUCHPAD_WAKE   Timer           TouchPad\nUART            ULP_WAKE        WDT             WDT_RESET\ndeepsleep       disable_irq     enable_irq      freq\nidle            lightsleep      mem16           mem32\nmem8            reset           reset_cause     sleep\ntime_pulse_us   unique_id       wake_reason\n>>> machine.<\/code><\/pre>\n\n\n\n<p>\uc640 \uac19\uc774 \uc0ac\uc6a9\uac00\ub2a5\ud55c \ubcc0\uc218 \uba85 \ud568\uc218\uba85\uc744 \ubcf4\uc5ec\uc8fc\uace0, \uc790\ub3d9\uc644\uc131\ub3c4 \uac00\ub2a5\ud568.<\/p>\n\n\n\n<ul><li><strong>\uae34 \ucf54\ub4dc \ubd99\uc5ec\ub123\uae30<\/strong><\/li><\/ul>\n\n\n\n<p>REPL\uc5d0\uc11c \uc608\uc81c \ucf54\ub4dc\ub098 \uc880 \uae34 \ucf54\ub4dc\ub97c \ud14c\uc2a4\ud2b8\ud574\ubcf4\uace0\uc790 \ud560 \uacbd\uc6b0, \ubcf5\uc0ac \ubd99\uc774\uae30 \ubaa8\ub4dc\uac00 \uc9c0\uc6d0\ub41c\ub2e4. \ud55c\uc904\uc529 \uc785\ub825\ud574\uc57c \ud558\ub294 \ubc88\uac70\ub85c\uc6c0\uc744 \uc880 \ub35c \uc218 \uc788\ub2e4. >>> \uc5d0\uc11c Ctrl+E\ud0a4\ub97c \ub204\ub974\uba74,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>>>> \npaste mode; Ctrl-C to cancel, Ctrl-D to finish\n=== \n<\/code><\/pre>\n\n\n\n<p>\uc640 \uac19\uc774 \ubcf4\uc774\uace0, \uc5ec\uae30\uc5d0 \uae34 \ucf54\ub4dc\ub97c \uc785\ub825\ud558\ub358\uc9c0, \uc544\ub2c8\uba74 \ub2e4\ub978 \uacf3\uc5d0\uc11c \ucf54\ub4dc\ub97c \ubcf5\uc0ac\ud574\uc11c \ubd99\uc778\ub2e4. \uc785\ub825\uc774 \uc644\ub8cc\ub418\uba74, Ctrl+D\ub97c \ub20c\ub7ec \ubaa8\ub4dc\ub97c \uc885\ub8cc\ud558\uba74 \uc785\ub825\ub41c \ucf54\ub4dc\ub97c \uc21c\ucc28\uc801\uc73c\ub85c \uc2e4\ud589\ud55c\ub2e4. \ucde8\uc18c\ud558\ub824\uba74 Ctrl+C.<\/p>\n\n\n\n<ul><li><strong>PC\uc5d0\uc11c \uc9c1\uc811 \uc2e4\ud589\ud558\uae30<\/strong><\/li><\/ul>\n\n\n\n<p>REPL\ubaa8\ub4dc\uac00 \uc544\ub2c8\uace0, PC\uc5d0\uc11c \ucf54\ub4dc\ub97c \uc644\uc131\ud558\uace0 \ubcf4\ub4dc\uc5d0 \uc62e\uae30\uc9c0 \uc54a\uace0 \ubc14\ub85c \uc2e4\ud589\uc774 \uac00\ub2a5\ud558\ub2e4. ampy\ub97c \uc774\uc6a9\ud558\uba74 \ub418\ub294\ub370,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ampy -p \/dev\/tty.SLAB_USBtoUART run &lt;your_code>.py<\/code><\/pre>\n\n\n\n<p>\uc640 \uac19\uc774 \uc2e4\ud589\ud558\uba74 \ubc14\ub85c \uc2e4\ud589 \uac00\ub2a5.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>REPL \uc811\uc18d(?) micropython\uc740 \uc790\uccb4\uc801\uc73c\ub85c REPL\uc744 \uc81c\uacf5\ud55c\ub2e4. UART0\ub97c \ud1b5\ud574 PC\uc640 \uc5f0\uacb0\ub418\uba70, \uc774\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc120 \uc2dc\ub9ac\uc5bc\ud1b5\uc2e0 \ud504\ub85c\uadf8\ub7a8(picom, putty \ub4f1)\uc744 \uc0ac\uc6a9\ud558\uac70\ub098, \ud130\ubbf8\ub110\uc5d0\uc11c screen \uba85\ub839 \ub4f1\uc744 \uc774\uc6a9\ud574\uc11c \uc774\uc6a9 \uac00\ub2a5\ud558\ub2e4. \uc811\uc18d \uc885\ub8cc\ub294 ctrl+a, ctrl+\\\ub97c \uc21c\uc11c\ub300\ub85c \ub204\ub978\ub2e4. REPL\uc5d0\uc11c \uc790\ub3d9\uc644\uc131 \uae30\ub2a5 \uc0ac\uc6a9 import \ud6c4, \ud639\uc740 \ub0b4\uc7a5 \ud391\uc158\uc744 \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\uc5d0 tab \ud0a4\ub97c \uc774\uc6a9\ud55c \uc790\ub3d9\uc644\uc131 \uae30\ub2a5\uc744 \uc81c\uacf5\ud55c\ub2e4. \uc608\ub97c \ub4e4\uc5b4 machine\uc744 import \ud558\uace0 machine.\uae4c\uc9c0 \uc785\ub825 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ahnbk.com\/?p=683\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MicroPython REPL \uc774\uac83\uc800\uac83 on ESP32&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"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,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[133],"tags":[135,134,142,141],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXSW-b1","jetpack-related-posts":[],"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/683"}],"collection":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=683"}],"version-history":[{"count":1,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":684,"href":"https:\/\/ahnbk.com\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions\/684"}],"wp:attachment":[{"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahnbk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}