{"id":6502,"date":"2020-02-12T01:20:34","date_gmt":"2020-02-11T16:20:34","guid":{"rendered":"http:\/\/www.hits-net.com\/blog\/?p=6502"},"modified":"2020-02-12T01:20:34","modified_gmt":"2020-02-11T16:20:34","slug":"codey-rockyesp32%e3%81%a7micropython%e3%82%92%e5%8b%95%e3%81%8b%e3%81%991","status":"publish","type":"post","link":"https:\/\/www.hits-net.com\/blog\/?p=6502","title":{"rendered":"codey rocky(ESP32)\u3067MicroPython\u3092\u52d5\u304b\u3059(1)"},"content":{"rendered":"<p>\u3069\u3082\u3002\u3053\u3093\u3070\u3093\u306f\u3002<\/p>\n<p>\u5148\u65e5\u8cfc\u5165\u3057\u305fcodey rocky\u304c\u601d\u3044\u306e\u5916\u8272\u3005\u3067\u304d\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u3001\u66f8\u3044\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>codey rocky\u306e\u958b\u5c01\u8a18\u4e8b\uff1a<a href=\"https:\/\/www.hits-net.com\/blog\/?p=6476\" target=\"_blank\" rel=\"noopener noreferrer\">STEM\u6559\u80b2\u7528\u306e\u304a\u3082\u3061\u3083\u300ccodey rocky\u300d\u3092\u8cb7\u3063\u3066\u307f\u305f<\/a><\/p>\n<p>\u3067\u3001\u524d\u56de\u306e\u8a18\u4e8b\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u306ecodey rocky\u306b\u306fESP32\u3068\u3044\u3046\u5236\u5fa1\u57fa\u677f\u304c\u642d\u8f09\u3055\u308c\u3066\u304a\u308a\u3001MicroPython\u3068\u3044\u3046Pythno\u306e\u5b9f\u88c5\u7cfb\u3067\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u53c2\u8003\u306b\u306a\u308b\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306a\u3069\uff1a<br \/>codey rocky\u306e\u958b\u767a\u5143\u3067\u3042\u308bMakeBlock\u793e\u306ePython API\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<br \/><a href=\"https:\/\/makeblock-micropython-api.readthedocs.io\/en\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/makeblock-micropython-api.readthedocs.io\/en\/latest\/<\/a><\/p>\n<p>MicroPython\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<br \/><a href=\"https:\/\/micropython-docs-ja.readthedocs.io\/ja\/latest\/index.html#\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/micropython-docs-ja.readthedocs.io\/ja\/latest\/index.html#<\/a><\/p>\n<p>\u3055\u3066\u3001\u3068\u308a\u3042\u3048\u305aPython\u3067\u8272\u3005\u52d5\u304b\u3059\u524d\u306b\u52d5\u4f5c\u78ba\u8a8d\u3068\u3044\u3046\u304b\u3001\u672c\u5f53\u306bMicroPython\u52d5\u304f\u3093\u3060\u3088\u306d\uff1f\u7684\u306a\u610f\u5473\u3082\u8fbc\u3081\u3066\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092mBlock\u304b\u3089\u6d41\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\u203bmBlock\u306e\u4f7f\u3044\u65b9\u306e\u7c21\u5358\u306a\u7d39\u4ecb\u306f<a href=\"https:\/\/www.hits-net.com\/blog\/?p=6476\" target=\"_blank\" rel=\"noopener noreferrer\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u3002<\/p>\n<p>\u306a\u304a\u3001Codey\u306e\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u306f\u300c23.01.013\u300d\u3067\u3059\u3002(mBlock\u4e0a\u3067\u78ba\u8a8d)<\/p>\n<pre>import codey, time, event\r\nimport uos\r\n\r\n@event.button_a_pressed\r\ndef on_button_a_pressed():    \r\n    codey.display.show('sysname:' + uos.uname().sysname, wait=True)\r\n    #codey.display.show('nodename:' + uos.uname().nodename, wait=True) same as sysname\r\n    codey.display.show('version:' + uos.uname().version, wait=True)\r\n    codey.display.show('release:' + uos.uname().release, wait=True)\r\n    codey.display.show('machine:' + uos.uname().machine, wait=True)<\/pre>\n<p>\u3053\u308c\u3092codey\u3078\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001codey\u306eLCD\u306b\u4ee5\u4e0b\u306e\u6587\u5b57\u5217\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\u203b\u624b\u66f8\u304d\u3067\u5199\u3057\u305f\u306e\u3067\u9593\u9055\u3063\u3066\u308b\u304b\u3082\u30fb\u30fb\u3002<\/p>\n<blockquote>\n<p>sysname:esp32<br \/>version:23_01_007_004-ht3-21-g28f29e21-dirty on 2019-12-03<br \/>release:0.0.0<br \/>machine:ESP32 module wth ESP32<\/p>\n<\/blockquote>\n<p>\u306a\u308b\u307b\u3069\u3002\u308f\u304b\u3089\u3093\u3002\u3051\u3069\u307e\u3041MicroPython\u306f\u52d5\u304f\u6a21\u69d8\u3002(&#8220;u&#8221;\u304b\u3089\u59cb\u307e\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306fMicroPython\u7528\u3089\u3057\u3044)<\/p>\n<p>\u7d9a\u3044\u3066\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u52d5\u4f5c\u3055\u305b\u3066\u307f\u307e\u3059\u3002<br \/>WiFi\u3078\u306e\u63a5\u7d9a\u90e8\u5206\u306fcodey\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u6d3b\u7528\u3057\u3066\u3001\u5916\u90e8\u3078HTTP GET\u3057\u3066\u8868\u793a\u3059\u308b\u3060\u3051\u306e\u5358\u7d14\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<br \/>HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u306fureqeust\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>import codey, time, event\r\n# import ureqeust\r\nimport urequests as requests\r\n\r\n@event.button_a_pressed\r\ndef on_button_a_pressed():\r\n    res = \"\"\r\n    codey.wifi.start('SSID', 'PASSWORD', codey.wifi.STA)\r\n    time.sleep(1)\r\n    if codey.wifi.is_connected():\r\n        codey.emotion.smile()\r\n        res = requests.get(url = 'https:\/\/www.hits-net.com\/blog\/ip2.php').text\r\n        codey.display.show(\"myIP:\" + res, wait=False)\r\n        \r\n    else:\r\n        codey.emotion.shiver()<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u3053\u306e\u30b5\u30fc\u30d0\u4e0a\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u8868\u793a\u3059\u308b\u3060\u3051\u306ePHP\u306e\u5b9f\u884c\u7d50\u679c\u3092\u62fe\u3063\u3066LCD\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3044\u3064\u30c7\u30d0\u30c3\u30b0\u304c\u8d85\u3057\u3065\u3089\u3044\u3002<br \/>MicroPython\u3060\u3068WebREPL\u3063\u3066\u3044\u3046\u30d6\u30e9\u30a6\u30b6\u7d4c\u7531\u3067\u5bfe\u8a71\u578b\u306b\u5b9f\u884c\u3059\u308b\u4ed5\u7d44\u307f\u3068\u304b\u3092\u4f7f\u3063\u3066\u7686\u3055\u3093\u3084\u3063\u3066\u308b\u307f\u305f\u3044\u306a\u306e\u3067\u3059\u304c\u3001codey\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8ee2\u9001\u3059\u308b\u4ed5\u7d44\u307f\u3001\u3063\u3066\u304b\u305d\u3082\u305d\u3082\u3067\u304d\u3093\u306e\u304b\u30fb\u30fb\u30fb\uff1f\u304c\u308f\u304b\u3089\u305a\u3001\u3068\u308a\u3042\u3048\u305a\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306e\u8868\u793a\u3068\u304bcodey\u306e\u52d5\u304d\u3092\u983c\u308a\u306b\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u3057\u304b\u306a\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u52d5\u3051\u3070\u3001\u3042\u3068\u306f\u3082\u3046\u30bb\u30f3\u30b5\u30fc\u306e\u7d50\u679c\u3092\u62fe\u3063\u3066POST\u3057\u305f\u308a\u3001\u5225\u306e\u30b5\u30fc\u30d0\u4e0a\u304b\u3089\u30b3\u30de\u30f3\u30c9\u3092GET\u3067\u62fe\u3063\u305f\u308a\u3068\u3044\u308d\u3044\u308d\u3067\u304d\u305d\u3046\u306a\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>codey rocky\u81ea\u4f53\u306b\u3082\u30af\u30e9\u30a6\u30c9\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3044\u3046\u6a5f\u80fd\u304c\u3042\u308b\u307f\u305f\u3044\u3067\u3059\u304c\u307e\u3060\u4f7f\u3044\u65b9\u304c\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u3002\u3002<br \/>\u3042\u3068\u5c06\u6765\u7684\u306bIFTTT\u306b\u5bfe\u5fdc\u3059\u308b\u3068\u304b\u3057\u306a\u3044\u3068\u304b\u306e\u8a71\u3082\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u8d64\u5916\u7dda\u5468\u308a\u3082\u4f7f\u3048\u305d\u3046\u306a\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u30ea\u30e2\u30b3\u30f3\u306b\u3082\u3067\u304d\u308b\u30fb\u30fb\u30fb\u304b\u306a\u3041\u3002<\/p>\n<p>\u3010\u30d0\u30c3\u30af\u30ca\u30f3\u30d0\u30fc\u3011<\/p>\n<ul>\n<li><a href=\"https:\/\/www.hits-net.com\/blog\/?p=6476\" target=\"_blank\" rel=\"noopener noreferrer\">STEM\u6559\u80b2\u7528\u306e\u304a\u3082\u3061\u3083\u300ccodey rocky\u300d\u3092\u8cb7\u3063\u3066\u307f\u305f<\/a><\/li>\n<\/ul>\n<p>\u3067\u306f\u3067\u306f\u3002\u307e\u305f\u306e\u6a5f\u4f1a\u306b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3002\u3053\u3093\u3070\u3093\u306f\u3002 \u5148\u65e5\u8cfc\u5165\u3057\u305fcodey rocky\u304c\u601d\u3044\u306e\u5916\u8272\u3005\u3067\u304d\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u3001\u66f8\u3044\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 codey rocky\u306e\u958b\u5c01\u8a18\u4e8b\uff1aSTEM\u6559\u80b2\u7528\u306e\u304a\u3082\u3061\u3083\u300ccodey rocky\u300d\u3092\u8cb7\u3063\u3066\u307f\u305f \u3067\u3001\u524d &hellip; <a href=\"https:\/\/www.hits-net.com\/blog\/?p=6502\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">codey rocky(ESP32)\u3067MicroPython\u3092\u52d5\u304b\u3059(1)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[97,3,4,30,29],"tags":[],"class_list":["post-6502","post","type-post","status-publish","format-standard","hentry","category-codey-rocky","category-3","category-4","category-30","category-29"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p4WH5i-1GS","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6502"}],"version-history":[{"count":8,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6502\/revisions"}],"predecessor-version":[{"id":6516,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6502\/revisions\/6516"}],"wp:attachment":[{"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hits-net.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}