{"id":36828,"date":"2018-06-21T05:19:42","date_gmt":"2018-06-20T20:19:42","guid":{"rendered":"http:\/\/kako.com\/blog\/?p=36828"},"modified":"2018-06-21T05:29:37","modified_gmt":"2018-06-20T20:29:37","slug":"microbit%e3%81%a7uart%e3%81%a8%e7%84%a1%e7%b7%9a%e9%80%9a%e4%bf%a1%e3%82%92%e3%83%96%e3%83%aa%e3%83%83%e3%82%b8%e3%81%97%e3%80%81%e3%82%b7%e3%83%aa%e3%82%a2%e3%83%ab%e9%80%9a%e4%bf%a1%e3%82%92","status":"publish","type":"post","link":"http:\/\/kako.com\/blog\/?p=36828","title":{"rendered":"micro:bit\u3067UART\u3068\u7121\u7dda\u901a\u4fe1\u3092\u30d6\u30ea\u30c3\u30b8\u3057\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u7121\u7dda\u5316\u3059\u308b\u306e\u3092\u8a66\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>micro:bit\u3067UART\u3068\u7121\u7dda\u901a\u4fe1\u3092\u30d6\u30ea\u30c3\u30b8\u3057\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u7121\u7dda\u5316\u3059\u308b\u306e\u3092\u8a66\u3057\u3066\u307f\u305f\u3002<\/p>\n<p><a href=\"http:\/\/kako.com\/blog\/?p=36777\">\u5148\u65e5\u306e\u7121\u7dda\u306e\u8a71<\/a>\u306e\u7d9a\u304d\u3067\u3001<a href=\"http:\/\/kako.com\/blog\/?p=36822\">UART\u306e\u30d7\u30ed\u30b0\u30e9\u30e0<\/a>\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u307f\u305f\u3002<\/p>\n<p><a href=\"http:\/\/kako.com\/blog\/wp\/wp-content\/uploads\/2018\/06\/Img_1469.jpg\"><img loading=\"lazy\" src=\"http:\/\/kako.com\/blog\/wp\/wp-content\/uploads\/2018\/06\/Img_1469.jpg\" alt=\"\" width=\"640\" height=\"480\" class=\"alignnone size-full wp-image-36829\" srcset=\"http:\/\/kako.com\/blog\/wp\/wp-content\/uploads\/2018\/06\/Img_1469.jpg 640w, http:\/\/kako.com\/blog\/wp\/wp-content\/uploads\/2018\/06\/Img_1469-300x225.jpg 300w, http:\/\/kako.com\/blog\/wp\/wp-content\/uploads\/2018\/06\/Img_1469-624x468.jpg 624w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>microPython\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nimport radio\r\nfrom microbit import display, Image, sleep, uart\r\n\r\ndisplay.show(Image.HAPPY)\r\nradio.on()\r\nuart.init(baudrate=9600, bits=8, parity=None, stop=1)\r\nwhile True:\r\n    if uart.any():\r\n        s=uart.read()\r\n        radio.send_bytes(s)\r\n    t=radio.receive_bytes()\r\n    if t is not None:\r\n        uart.write(t)\r\n<\/pre>\n<p><!--more--><\/p>\n<p>micro:bit\u30922\u3064\u4f7f\u3063\u3066\u3001\u4e21\u65b9\u3068\u3082\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u8fbc\u3080\u3002<br \/>\nPC\u30922\u3064\u7528\u610f\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u306ePC\u306b\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u8fbc\u307f\u6e08\u307f\u306emicro:bit\u3092USB\u3067\u63a5\u7d9a\u3059\u308b\u3002<br \/>\nPC\u306b\u306fmicro:bit\u304c\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308bCOM:\u30dd\u30fc\u30c8\u304c\u3042\u308a\u3001\u305d\u306eCOM:\u30dd\u30fc\u30c8\u3092TeraTerm\u306a\u3069\u3067\u958b\u304f\u3002<br \/>\n\u7247\u65b9\u306ePC\u304b\u3089\u6587\u5b57\u3092\u9001\u4fe1\u3059\u308b\u3068\u3001\u3082\u3046\u7247\u65b9\u306ePC\u306b\u5c4a\u3044\u3066\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n(micro:bit\u30923\u3064\u4ee5\u4e0a\u3092\u4f7f\u3063\u305f\u5834\u5408\u306f\u30011\u53f0\u304b\u3089\u9001\u4fe1\u3057\u305f\u30c7\u30fc\u30bf\u304c\u4ed6\u306emicro:bit\u3059\u3079\u3066\u3067\u30c7\u30fc\u30bf\u304c\u53d7\u4fe1\u3055\u308c\u308b)<\/p>\n<p>UART\u306f\u3001PC\u3068\u7e4b\u3050\u3060\u3051\u3067\u306f\u306a\u304f\u3001micro:bit\u306e\u57fa\u677f\u30a8\u30c3\u30b8\u30b3\u30cd\u30af\u30bf\u306e\u30d4\u30f3\u306b\u5272\u308a\u5f53\u3066\u3066\u96fb\u6c17\u7684\u306b\u53d6\u308a\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3060\u3002<br \/>\n\u305d\u3046\u3059\u308c\u3070\u3001PC\u4ee5\u5916\u306b\u597d\u304d\u306a\u30de\u30a4\u30b3\u30f3\u7b49\u3068\u3082\u901a\u4fe1\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u4ee5\u524d\u306f\u3001UART\u3092\u7121\u7dda\u5316\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5024\u6bb5\u304c\u9ad8\u3044\u30ad\u30c3\u30c8\u3092\u8cb7\u3063\u305f\u308a\u3057\u3066\u3044\u305f\u3002<br \/>\nNordic Semiconductor\u306e\u72ec\u81ea\u65b9\u5f0f\u306e\u7121\u7dda\u7528\u3060\u3068\u3001<a href=\"http:\/\/www.k2-denshi.com\/\">\u30b1\u30fc\u30c4\u30fc\u96fb\u5b50\u5de5\u696d<\/a>\u306e\u30ad\u30c3\u30c8\u3068\u304b\u304c\u3042\u308b\u3002<br \/>\nBluetooth\u3092\u4f7f\u3063\u305f\u3082\u306e\u3060\u3068\u3001<a href=\"http:\/\/musenka.com\/\">\u7121\u7dda\u5316.com<\/a>\u306eZEAL\u30b7\u30ea\u30fc\u30ba\u306a\u3069\u304c\u3042\u308b\u3002<\/p>\n<p>\u305d\u308c\u306b\u6bd4\u3079\u308b\u3068\u3001\u3053\u3061\u3089\u306fmicro:bit\u30922\u500b\u4f7f\u3046\u3060\u3051\u306a\u306e\u3067\u30014000\u5186\u5c11\u3005\u3067\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u7121\u7dda\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n\u3053\u306e\u9762\u3067micro:bit\u306f\u3044\u308d\u3044\u308d\u5fdc\u7528\u304c\u3067\u304d\u305d\u3046\u306a\u306e\u3067\u3001\u304a\u85a6\u3081\u3060\u3002<\/p>\n<p>\u96e3\u70b9\u306f\u3001\u3042\u307e\u308a\u7121\u7dda\u306e\u96fb\u6ce2\u304c\u98db\u3070\u306a\u3044\u305f\u3081\u90e8\u5c4b\u306e\u4e2d\u304b\u305b\u3044\u305c\u3044\u96a3\u306e\u90e8\u5c4b\u304f\u3089\u3044\u307e\u3067\u3057\u304b\u4f7f\u3048\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3068\u3001\u5b9f\u969b\u306b\u5fdc\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u6df7\u4fe1\u5bfe\u7b56\u3084\u901a\u4fe1\u30a8\u30e9\u30fc\u5bfe\u7b56\u3084\u6697\u53f7\u5316\u51e6\u7406\u3068\u304b\u3092\u5165\u308c\u308b\u306e\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u8907\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u3053\u3068\u3060\u308d\u3046\u3002<\/p>\n<p><iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?ref=qf_sp_asin_til&#038;t=gid023014-22&#038;m=amazon&#038;o=9&#038;p=8&#038;l=as1&#038;IS2=1&#038;detail=1&#038;asins=B077SY4XS5&#038;linkId=77d851d2dc23d5e9e8b6354ea704a4ca&#038;bc1=000000&#038;lt1=_blank&#038;fc1=333333&#038;lc1=0066c0&#038;bg1=ffffff&#038;f=ifr\"><br \/>\n    <\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>micro:bit\u3067UART\u3068\u7121\u7dda\u901a\u4fe1\u3092\u30d6\u30ea\u30c3\u30b8\u3057\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u7121\u7dda\u5316\u3059\u308b\u306e\u3092\u8a66\u3057\u3066\u307f\u305f\u3002 \u5148\u65e5\u306e\u7121\u7dda\u306e\u8a71\u306e\u7d9a\u304d\u3067\u3001UART\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u307f\u305f\u3002 microPython\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u305f\u3002<\/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\/36828"}],"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=36828"}],"version-history":[{"count":6,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/36828\/revisions"}],"predecessor-version":[{"id":36835,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/36828\/revisions\/36835"}],"wp:attachment":[{"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36828"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kako.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}