{"id":37812,"date":"2018-08-09T08:27:09","date_gmt":"2018-08-08T23:27:09","guid":{"rendered":"http:\/\/kako.com\/blog\/?p=37812"},"modified":"2020-02-03T15:52:10","modified_gmt":"2020-02-03T06:52:10","slug":"m5stack%e3%81%a8microbit%e3%82%92%e5%90%88%e4%bd%93%e3%81%95%e3%81%9b%e3%81%a6%e3%81%bf%e3%82%8b-%e3%81%9d%e3%81%ae2-m5stack%e5%81%b4%e3%81%a7%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e3%81%84%e3%82%8b","status":"publish","type":"post","link":"http:\/\/kako.com\/blog\/?p=37812","title":{"rendered":"M5Stack\u3068micro:bit\u3092\u5408\u4f53\u3055\u305b\u3066\u307f\u308b &#8211; \u305d\u306e2 (M5Stack\u5074\u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30e0)"},"content":{"rendered":"<p><a href=\"http:\/\/kako.com\/blog\/?p=37757\">M5Stack\u3068micro:bit\u3092\u5408\u4f53\u3055\u305b\u3066\u307f\u308b\u3068\u3044\u3046\u8a71<\/a>\u306e\u7d9a\u304d\u3002<\/p>\n<p>M5Stack\u5074\u306b\u5165\u308c\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u65b9\u6cd5\u3068\u3057\u3066\u306f\u4e3b\u306a\u3082\u306e\u306f3\u3064\u3042\u308b\u3002<br \/>\n(1) Arduino\u958b\u767a\u74b0\u5883\u3067\u3001ESP32\u30e9\u30a4\u30d6\u30e9\u30ea+M5Stack\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u3001\u8a00\u8a9e\u306f\u307b\u307cC++\u3002<br \/>\n(2) Espressif\u306e\u958b\u767a\u74b0\u5883ESP-IDF\u3068SDK\u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u3001\u8a00\u8a9e\u306f\u539f\u5247C\u8a00\u8a9e\u3002<br \/>\n(3) microPython<\/p>\n<p>micro:bit\u5074\u306fmicroPython\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001M5Stack\u5074\u3082microPython\u3092\u4f7f\u3063\u3066\u307f\u305f\u3044\u306e\u3060\u304c\u3001\u81ea\u5206\u306f\u307e\u3060Python\u3092\u4f7f\u3046\u306e\u304c\u5f97\u610f\u3067\u306a\u3044\u306e\u3067\u51fa\u6765\u3066\u3044\u306a\u3044\u3002<br \/>\n\u7d50\u5c40\u3001\u4e00\u756a\u7c21\u5358\u306aArduino\u3067\u958b\u767a\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305aSerial2\u3068\u3044\u3046M5Stack\u7528\u306eexample\u3092\u3061\u3087\u3063\u3068\u3060\u3051\u6539\u5909\u3057\u3066\u3001\u753b\u9762\u306b\u53d7\u4fe1\u3057\u305f\u6587\u5b57\u5217\u3092\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u305f\u3002<\/p>\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u8a8c2018\u5e749\u6708\u53f7\u306a\u3069\u3092\u53c2\u8003\u306b\u3057\u3066\u3044\u308b\u3002<br \/>\n<a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B07D58QQ5G\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B07D58QQ5G&amp;linkCode=as2&amp;tag=gid023014-22&amp;linkId=f5206c4f0c812566bdeb47e5eb717a50\" target=\"_blank\" rel=\"noopener noreferrer\"><img src=\"\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;MarketPlace=JP&amp;ASIN=B07D58QQ5G&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL250_&amp;tag=gid023014-22\" border=\"0\" \/><\/a><img loading=\"lazy\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=gid023014-22&amp;l=am2&amp;o=9&amp;a=B07D58QQ5G\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/><br \/>\n<a href=\"https:\/\/www.amazon.co.jp\/gp\/product\/B07D58QQ5G\/ref=as_li_tl?ie=UTF8&amp;camp=247&amp;creative=1211&amp;creativeASIN=B07D58QQ5G&amp;linkCode=as2&amp;tag=gid023014-22&amp;linkId=d6fbdcf9e5fb02cf1bfbe95e4c8785ce\" target=\"_blank\" rel=\"noopener noreferrer\">Interface(\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9) 2018\u5e74 09 \u6708\u53f7<\/a><img loading=\"lazy\" style=\"border: none !important; margin: 0px !important;\" src=\"\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=gid023014-22&amp;l=am2&amp;o=9&amp;a=B07D58QQ5G\" alt=\"\" width=\"1\" height=\"1\" border=\"0\" \/>(Amazon)<br \/>\n<!--more--><\/p>\n<pre><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &amp;amp;amp;amp;lt;M5Stack.h&amp;amp;amp;amp;gt;\n\nHardwareSerial Serial2(2);\n\nvoid setup() {\n\n  M5.begin();\n  \/\/ LCD display\n  M5.Lcd.print(&quot;serial test\\r\\n&quot;);\n\n  Serial.begin(9600);\n\n  \/\/ Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)\n  Serial2.begin(9600, SERIAL_8N1, 16, 17);\n}\n\nvoid loop() {\n\n  if(Serial.available()) {\n    int ch = Serial.read();\n    Serial2.write(ch);\n    M5.Lcd.setTextColor(GREEN);\n  }\n\n  if(Serial2.available()) {\n    int ch = Serial2.read();\n    Serial.write(ch);\n    M5.Lcd.setTextColor(WHITE);\n    M5.Lcd.printf(&quot;%c&quot;,ch);\n  }\n}\n<\/pre>\n<p>USB-UART\u306e\u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8\u3068\u3001\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u306eUART\u30d4\u30f3TX2\/RX2\u306e\u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8\u3068\u306e2\u3064\u306e\u30dd\u30fc\u30c8\u3092\u958b\u3044\u3066\u3001\u305d\u308c\u305e\u308c\u3067\u53d7\u4fe1\u3057\u305f\u5185\u5bb9\u3092\u3082\u3046\u4e00\u65b9\u3078\u3068\u9001\u4fe1\u3057\u3001\u305d\u306e\u901a\u4fe1\u5185\u5bb9\u3092\u6db2\u6676\u753b\u9762\u306b\u66f8\u304d\u51fa\u3057\u3066\u3044\u308b\u3002<br \/>\n\u7c21\u5358\u306a\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u30e2\u30cb\u30bf\u30fc\u8868\u793a\u30bd\u30d5\u30c8\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u3002<\/p>\n<p>micro:bit\u304c\u7121\u7dda\u3067\u53d7\u4fe1\u3057\u305f\u5185\u5bb9\u306f\u3001\u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8\u3067M5Stack\u306b\u9001\u3089\u308c\u3066\u3001M5Stack\u3067\u306fUSB-UART\u5074\u306b\u9001\u4fe1\u3055\u308c\u3001\u540c\u6642\u306b\u753b\u9762\u306b\u3082\u305d\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n\u9006\u65b9\u5411\u306f\u3001micro:bit\u306bUSB-UART\u5074\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u3066\u3044\u308b\u306e\u3060\u304c\u3001micro:bit\u306e\u53d7\u4fe1\u5074\u306e\u51e6\u7406\u3092\u66f8\u3044\u3066\u3044\u306a\u3044\u306e\u3067\u7121\u8996\u3055\u308c\u308b\u3002<\/p>\n<p>\u3068\u3001\u3053\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>USB-UART\u3067PC\u3068\u7e4b\u3044\u3067\u3001\u7121\u7dda\u5074\u3067\u8a08\u6e2c\u3057\u3066\u9001\u4fe1\u3055\u308c\u3066\u304d\u305f\u30c7\u30fc\u30bf\u306e\u30ed\u30b0\u3092\u53d6\u3063\u305f\u308a\u3067\u304d\u308b\u3002<br \/>\n\u6b21\u306f\u3001\u3053\u306e\u90e8\u5206\u3092\u6709\u7dda\u3067\u306f\u306a\u304fWiFi\u3067PC\u3068\u304b\u30af\u30e9\u30a6\u30c9\u306b\u30c7\u30fc\u30bf\u3092\u8a18\u9332\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u308b\u3002<\/p>\n<p>&#8212;<br \/>\n\u8ffd\u8a18<\/p>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306fM5Stack\u7528\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u30d3\u30eb\u30c9\u304c\u901a\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>Serial2\u3068\u3044\u3046\u306e\u304cM5Stack\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u5185\u3067\u4f7f\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u885d\u7a81\u3057\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n<p>\u5bfe\u7b56\u3068\u3057\u3066\u306f\u3001\u5148\u982d\u306e\u307b\u3046\u3067HardwareSerial\u3068\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u306e\u3092\u524a\u9664\u3059\u308c\u3070\u3088\u3044\u3002<\/p>\n<p>\u3042\u308b\u3044\u306f\u3001Serial2\u3068\u66f8\u3044\u3066\u3042\u308b\u306e\u3092\u3001mySerial2\u3068\u304b\u306e\u5225\u306e\u540d\u524d\u306b\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>M5Stack\u3068micro:bit\u3092\u5408\u4f53\u3055\u305b\u3066\u307f\u308b\u3068\u3044\u3046\u8a71\u306e\u7d9a\u304d\u3002 M5Stack\u5074\u306b\u5165\u308c\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u65b9\u6cd5\u3068\u3057\u3066\u306f\u4e3b\u306a\u3082\u306e\u306f3\u3064\u3042\u308b\u3002 (1) Arduino\u958b\u767a\u74b0\u5883\u3067\u3001ESP32\u30e9\u30a4\u30d6\u30e9\u30ea+M5Stack\u7528\u30e9\u30a4\u30d6 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,14],"tags":[],"_links":{"self":[{"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37812"}],"collection":[{"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37812"}],"version-history":[{"count":9,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37812\/revisions"}],"predecessor-version":[{"id":47408,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37812\/revisions\/47408"}],"wp:attachment":[{"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37812"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}