{"id":4832,"date":"2016-12-18T23:47:41","date_gmt":"2016-12-18T14:47:41","guid":{"rendered":"https:\/\/peta.okechan.net\/blog\/?p=4832"},"modified":"2016-12-19T21:15:46","modified_gmt":"2016-12-19T12:15:46","slug":"arduino%e3%81%ae%e3%82%b7%e3%83%aa%e3%82%a2%e3%83%ab%e9%80%9a%e4%bf%a1%e3%81%ae%e3%83%9c%e3%83%bc%e3%83%ac%e3%83%bc%e3%83%88","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/4832","title":{"rendered":"Arduino\u306e\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u30dc\u30fc\u30ec\u30fc\u30c8"},"content":{"rendered":"<p>\u6700\u8fd1\u3001<a href=\"http:\/\/amzn.to\/2gYRGAx\">HiLetgo Mini USB Nano V3.0 ATmega328P CH340G 5V 16M \u30de\u30a4\u30af\u30ed\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30dc\u30fc\u30c9 Arduino\u3068\u4e92\u63db<\/a>\u3068\u3044\u3046\u4e2d\u56fd\u88fd\u306eArduino Nano\u30af\u30ed\u30fc\u30f3\u3092\u5165\u624b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4e2d\u56fd\u304b\u3089\u306e\u767a\u9001\u3068\u306a\u308b\u305f\u3081\u5230\u7740\u306b2\u9031\u9593\u304f\u3089\u3044\u304b\u304b\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u3082330\u5186\u3068\u3044\u3046\u3081\u3061\u3083\u5b89\u4fa1\u683c\u3067\u666e\u901a\u306b\u52d5\u4f5c\u3059\u308b\u306e\u3067\u6e80\u8db3\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u3055\u3066\u304a\u304d\u3001\u540c\u6642\u306b\u4ee5\u4e0b\u306e2\u88fd\u54c1\u3001\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u8d64\u5916\u7dda\u9001\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u5165\u624b\u3057\u3001Arduino\u3067\u5b66\u7fd2\u30ea\u30e2\u30b3\u30f3\u307f\u305f\u3044\u306a\u3082\u306e\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<br \/>\n<a href=\"http:\/\/amzn.to\/2hVoegh\">HiLetgo 38kHz \u8d64\u5916\u7dda\u53d7\u4fe1\u6a5f\u30e2\u30b8\u30e5\u30fc\u30eb IR \u30ec\u30b7\u30fc\u30d0\u30fc\u3000Arduino \u96fb\u5b50\u5efa\u7269\u77e5\u80fd\u30ed\u30dc\u30c3\u30c8 [\u4e26\u884c\u8f38\u5165\u54c1]<\/a><br \/>\n<a href=\"http:\/\/amzn.to\/2gYVUb9\">HiLetgo \u8d64\u5916\u7dda\u9001\u4fe1\u6a5f\u30e2\u30b8\u30e5\u30fc\u30eb IR \u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u30fc Arduino \u96fb\u5b50\u5efa\u7269\u77e5\u80fd\u30ed\u30dc\u30c3\u30c8 LED\u8868\u793a [\u4e26\u884c\u8f38\u5165\u54c1]<\/a><\/p>\n<h3>\u3053\u3093\u306a\u611f\u3058<\/h3>\n<p><a href=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/CzeZiJIUAAQbhgA-large-e1482068945972.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/CzeZiJIUAAQbhgA-large-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-4839\" \/><\/a><\/p>\n<h3>\u30bd\u30fc\u30b9\u306f\u3053\u3053<\/h3>\n<p><a href=\"https:\/\/github.com\/peta-okechan\/irecho\">https:\/\/github.com\/peta-okechan\/irecho<\/a><br \/>\n(<a href=\"https:\/\/github.com\/z3t0\/Arduino-IRremote\">IRremote<\/a>\u3068\u3044\u3046Arduino\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059)<\/p>\n<p>\u4ed5\u7d44\u307f\u3068\u3057\u3066\u306fPC(Python\u30b9\u30af\u30ea\u30d7\u30c8)\u304b\u3089\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067Arduino\u306b\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u53d7\u4fe1 or \u9001\u4fe1\u306e\u30b3\u30de\u30f3\u30c9\u3092\u9001\u4fe1\u3059\u308b\u611f\u3058\u3067\u3059\u3002<br \/>\nArduino\u3067\u53d7\u4fe1\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u30c7\u30fc\u30bf\u3092PC\u306b\u4fdd\u5b58\u3057\u305f\u308a\u3001PC\u306b\u4fdd\u5b58\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u30c7\u30fc\u30bf\u3092Arduino\u306b\u9001\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u3067\u5b66\u7fd2\u30ea\u30e2\u30b3\u30f3\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u307e\u3059\u3002<\/p>\n<h3>\u554f\u984c\u70b9<\/h3>\n<p>\u3067\u307e\u3041\u5b89\u5b9a\u3057\u3066\u52d5\u4f5c\u306f\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u751f\u30c7\u30fc\u30bf\u3092\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u3084\u308a\u3068\u308a\u3059\u308b\u306e\u3067\u305d\u306e\u3078\u3093\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u53d7\u4fe1\u3001\u3064\u307e\u308a\u5b66\u7fd2\u306f\u57fa\u672c\u6700\u521d\u306e1\u56de\u3084\u308c\u3070\u6e08\u3080\u306e\u3067\u3042\u307e\u308a\u6c17\u306b\u306a\u3089\u306a\u3044\u3093\u3067\u3059\u3051\u3069\u3082\u3001\u9001\u4fe1\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3068\u7d50\u69cb\u4e0d\u4fbf\u3067\u3059\u3002<br \/>\n\u79c1\u304c\u5b66\u7fd2\u3055\u305b\u305f\u30ea\u30e2\u30b3\u30f3\u306e\u5834\u5408\u3060\u3068\u9001\u4fe1\u306b1\u79d2\u304f\u3089\u3044\u304b\u304b\u308b\u306e\u3067\u3001\u4f8b\u3048\u3070\u30c6\u30ec\u30d3\u306e\u30ea\u30e2\u30b3\u30f3\u306e\u8907\u6570\u306e\u30dc\u30bf\u30f3\u3092\u9023\u7d9a\u3057\u3066\u30d1\u30d1\u30d1\u30c3\u3068\u64cd\u4f5c\u3059\u308b\u3088\u3046\u306a\u5834\u5408\u306e\u30ea\u30a2\u30eb\u30ea\u30e2\u30b3\u30f3\u306e\u4f7f\u3044\u52dd\u624b\u3068\u304f\u3089\u3079\u308b\u3068\u3001\u975e\u5e38\u306b\u4f7f\u3044\u3065\u3089\u3044\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u751f\u30c7\u30fc\u30bf\u3092\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u3084\u308a\u3068\u308a\u3057\u3066\u308b\u306e\u304c\u539f\u56e0\u306a\u306e\u3067\u3001\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3088\u3046\u306b\u3059\u308b\u3068\u89e3\u6c7a\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nIRremote\u306b\u306f\u751f\u30c7\u30fc\u30bf\u3060\u3051\u3067\u306a\u304f\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u4ed5\u7d44\u307f\u3082\u3042\u308b\u306e\u3067\u3001\u3068\u3044\u3046\u304b\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u306e\u304c\u4e3b\u76ee\u7684\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306a\u306e\u3067\u3001\u5bfe\u5fdc\u306f\u305d\u3046\u96e3\u3057\u304f\u306f\u306a\u3044\u306f\u305a\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3068\u3044\u3046\u306e\u306f\u3001\u4f8b\u3048\u3070NEC\u65b9\u5f0f\u306e\u4fe1\u53f7\u306e12345(32bit\u30c7\u30fc\u30bf)\u307f\u305f\u3044\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u5834\u54081\u4fe1\u53f7\u30675\u30d0\u30a4\u30c8\u3042\u308c\u3070\u5341\u5206\u306b\u8868\u73fe\u3067\u304d\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u751f\u30c7\u30fc\u30bf\u3060\u3068\u79c1\u304c\u5b66\u7fd2\u3055\u305b\u305f\u30ea\u30e2\u30b3\u30f3\u306e\u5834\u5408\u30011\u4fe1\u53f7\u3042\u305f\u308a32bit\u6574\u657068\u500b\u5206\u304f\u3089\u3044\u3067\u3001\u5358\u7d14\u8a08\u7b97\u3067272\u30d0\u30a4\u30c8\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30c7\u30b3\u30fc\u30c9\u6e08\u307f\u30c7\u30fc\u30bf\u3068\u6bd4\u3079\u308b\u306850\u500d\u4ee5\u4e0a\u306e\u30b5\u30a4\u30ba\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3055\u3089\u306b\u4eca\u56de\u30c7\u30d0\u30c3\u30b0\u306e\u3057\u3084\u3059\u3055\u3092\u8003\u616e\u3057\u3066\u751f\u30c7\u30fc\u30bf\u3092\u6574\u6570\u3058\u3083\u306a\u304f\u3066\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u6587\u5b57\u5217\u3068\u3057\u3066\u9001\u4fe1\u3057\u3066\u307e\u3059\u306e\u3067300\u30d0\u30a4\u30c8\u4ee5\u4e0a\u306b\u306a\u3063\u3066\u307e\u3059\u3002<br \/>\n\u5404\u6574\u6570\u304c3\uff5e5\u6841\u306b\u53ce\u307e\u3063\u3066\u308b\u306e\u3067\u3053\u306e\u7a0b\u5ea6\u3067\u6e08\u3093\u3067\u307e\u3059\u3051\u3069\u3001\u304b\u306a\u308a\u7121\u99c4\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<p>\u5f8c\u3005\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3088\u3046\u5909\u66f4\u3059\u308b\u3068\u3057\u3066\u3001\u73fe\u72b6\u306e\u4ed5\u69d8\u306e\u307e\u307e\u3067\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u901f\u5ea6\u3092\u5909\u3048\u305f\u3089\u3069\u306e\u304f\u3089\u3044\u51e6\u7406\u901f\u5ea6\u306b\u5909\u5316\u304c\u3042\u308b\u304b\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u6e2c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u8a08\u6e2c\u306b\u4f7f\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#!\/usr\/bin\/env python\r\n# coding=utf-8\r\n\r\nimport subprocess\r\nimport timeit\r\n\r\n\r\ndef main():\r\n    command = &#x5B;\r\n        'python', 'irecho.py', 'send', '--serial-port', 'COM3', '--name', 'ue',\r\n    ]\r\n    result = timeit.timeit(\r\n        '''subprocess.run(\r\n            command, stdout=subprocess.PIPE, stderr=subprocess.PIPE\r\n        )''',\r\n        'import subprocess',\r\n        number=10,\r\n        globals={'command': command}\r\n    )\r\n    print(result)\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n<\/pre>\n<p>\u9001\u4fe1\u51e6\u7406\u309210\u56de\u884c\u3063\u3066\u305d\u306e\u5408\u8a08\u6642\u9593\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n<ins datetime=\"2016-12-19T12:12:40+00:00\">\u8ffd\u8a18: \u3053\u308c\u6700\u521d\u306eimport subprocess\u306f\u3044\u3089\u306a\u3044\u3067\u3059\u306dw<\/ins><\/p>\n<p>\u3053\u308c\u3092\u5143\u306e\u30bd\u30fc\u30b9\u3092\u66f8\u304d\u63db\u3048\u306a\u304c\u30892400bps\u304b\u3089230400bps\u307e\u3067\u8a08\u6e2c\u3057\u305f\u7d50\u679c\u304c\u4ee5\u4e0b\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png\" alt=\"\" width=\"929\" height=\"422\" class=\"aligncenter size-full wp-image-4845\" srcset=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png 929w, https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph-300x136.png 300w, https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph-768x349.png 768w\" sizes=\"auto, (max-width: 929px) 100vw, 929px\" \/><\/a><\/p>\n<table>\n<tr>\n<td>2400bps<\/td>\n<td>31.465807555238776\u79d2<\/td>\n<\/tr>\n<tr>\n<td>4800bps<\/td>\n<td>16.709830173437872\u79d2<\/td>\n<\/tr>\n<tr>\n<td>9600bps<\/td>\n<td>10.859490425279164\u79d2<\/td>\n<\/tr>\n<tr>\n<td>14400bps<\/td>\n<td>6.955400712758374\u79d2<\/td>\n<\/tr>\n<tr>\n<td>19200bps<\/td>\n<td>5.69991770016631\u79d2<\/td>\n<\/tr>\n<tr>\n<td>28800bps<\/td>\n<td>4.4919952482775\u79d2<\/td>\n<\/tr>\n<tr>\n<td>38400bps<\/td>\n<td>3.902442195295795\u79d2<\/td>\n<\/tr>\n<tr>\n<td>57600bps<\/td>\n<td>3.2598146828225234\u79d2<\/td>\n<\/tr>\n<tr>\n<td>76800bps<\/td>\n<td>2.9445462580185318\u79d2<\/td>\n<\/tr>\n<tr>\n<td>115200bps<\/td>\n<td>2.5869034925160372\u79d2<\/td>\n<\/tr>\n<tr>\n<td>230400bps<\/td>\n<td>51.266840769779044\u79d2<\/td>\n<\/tr>\n<\/table>\n<p>\u5143\u304c9600bps\u3060\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u308210\u56de\u306e\u9001\u4fe1\u51e6\u7406\u3067\u7d0410\u79d2\u3067\u3084\u306f\u308a1\u56de\u306e\u9001\u4fe1\u51e6\u7406\u3042\u305f\u308a1\u79d2\u304f\u3089\u3044\u304b\u304b\u3063\u3066\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>\n2400bps\u304b\u308919200bps\u307e\u3067\u306f\u30dc\u30fc\u30ec\u30fc\u30c8\u306b\u5fdc\u3058\u3066\u7d50\u69cb\u901f\u304f\u306a\u308b\u611f\u3058\u3067\u3059\u3051\u3069\u3082\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u4ee5\u5916\u306e\u51e6\u7406\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306e\u4e3b\u8981\u56e0\u306b\u306a\u308a\u306f\u3058\u3081\u308b\u3068\u601d\u308f\u308c\u308b19200bps\u4ee5\u964d\u306f\u3042\u3093\u307e\u308a\u901f\u304f\u306a\u3089\u306a\u3044\u611f\u3058\u3067\u3059\u306d\u3002<br \/>\n230400bps\u3067\u30b0\u30e9\u30d5\u304c\u8df3\u306d\u4e0a\u304c\u3063\u3066\u307e\u3059\u3051\u3069\u3082\u3001\u3053\u308c\u306f\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306b\u5931\u6557\u3057\u3066PC\u5074\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3068Arduino\u304c\u3046\u307e\u304f\u9023\u643a\u51fa\u6765\u306a\u304f\u306a\u308a\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u304c\u767a\u751f\u3059\u308b\u307e\u3067\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u305b\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\nArduino\u5074\u306e\u30bd\u30fc\u30b9\u3067\u9001\u4fe1\u6642\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u306f5\u79d2\u3068\u3057\u3066\u307e\u3059\u306e\u3067\u300110\u56de\u306e\u51e6\u7406\u3067\u7d0451\u79d2\u304b\u304b\u3063\u305f\u3068\u3044\u3046\u3053\u3068\u306f10\u56de\u5168\u3066\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u3066\u308b\u3082\u306e\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>115200bps\u304c\u4e00\u756a\u901f\u3044\u3093\u3067\u3059\u3051\u3069\u3082\u901a\u4fe1\u306e\u5b89\u5b9a\u6027\u3068\u3044\u3046\u70b9\u3067\u5c11\u3057\u5fc3\u914d\u306a\u306e\u3067\u3072\u3068\u3064\u4e0b\u306e76800bps\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u601d\u3063\u305f\u3088\u308a\u52b9\u679c\u304c\u9ad8\u304b\u3063\u305f\u306e\u3067\u6839\u672c\u89e3\u6c7a\u3059\u308b\u307e\u3048\u306b\u30dc\u30fc\u30ec\u30fc\u30c8\u3092\u4e0a\u3052\u3066\u3057\u3070\u3089\u304f\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3001<a href=\"http:\/\/amzn.to\/2gYRGAx\">HiLetgo Mini USB Nano V3.0 ATmega328P CH340G 5V 16M \u30de\u30a4\u30af\u30ed\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30dc\u30fc\u30c9 Arduino\u3068\u4e92\u63db<\/a>\u3068\u3044\u3046\u4e2d\u56fd\u88fd\u306eArduino Nano\u30af\u30ed\u30fc\u30f3\u3092\u5165\u624b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u4e2d\u56fd\u304b\u3089\u306e\u767a\u9001\u3068\u306a\u308b\u305f\u3081\u5230\u7740\u306b2\u9031\u9593\u304f\u3089\u3044\u304b\u304b\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u3082330\u5186\u3068\u3044\u3046\u3081\u3061\u3083\u5b89\u4fa1\u683c\u3067\u666e\u901a\u306b\u52d5\u4f5c\u3059\u308b\u306e\u3067\u6e80\u8db3\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u3055\u3066\u304a\u304d\u3001\u540c\u6642\u306b\u4ee5\u4e0b\u306e2\u88fd\u54c1\u3001\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u8d64\u5916\u7dda\u9001\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u5165\u624b\u3057\u3001Arduino\u3067\u5b66\u7fd2\u30ea\u30e2\u30b3\u30f3\u307f\u305f\u3044\u306a\u3082\u306e\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<br \/>\n<a href=\"http:\/\/amzn.to\/2hVoegh\">HiLetgo 38kHz \u8d64\u5916\u7dda\u53d7\u4fe1\u6a5f\u30e2\u30b8\u30e5\u30fc\u30eb IR \u30ec\u30b7\u30fc\u30d0\u30fc\u3000Arduino \u96fb\u5b50\u5efa\u7269\u77e5\u80fd\u30ed\u30dc\u30c3\u30c8 [\u4e26\u884c\u8f38\u5165\u54c1]<\/a><br \/>\n<a href=\"http:\/\/amzn.to\/2gYVUb9\">HiLetgo \u8d64\u5916\u7dda\u9001\u4fe1\u6a5f\u30e2\u30b8\u30e5\u30fc\u30eb IR \u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u30fc Arduino \u96fb\u5b50\u5efa\u7269\u77e5\u80fd\u30ed\u30dc\u30c3\u30c8 LED\u8868\u793a [\u4e26\u884c\u8f38\u5165\u54c1]<\/a><\/p>\n<h3>\u3053\u3093\u306a\u611f\u3058<\/h3>\n<p><a href=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/CzeZiJIUAAQbhgA-large-e1482068945972.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/CzeZiJIUAAQbhgA-large-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-4839\" \/><\/a><\/p>\n<h3>\u30bd\u30fc\u30b9\u306f\u3053\u3053<\/h3>\n<p><a href=\"https:\/\/github.com\/peta-okechan\/irecho\">https:\/\/github.com\/peta-okechan\/irecho<\/a><br \/>\n(<a href=\"https:\/\/github.com\/z3t0\/Arduino-IRremote\">IRremote<\/a>\u3068\u3044\u3046Arduino\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059)<\/p>\n<p>\u4ed5\u7d44\u307f\u3068\u3057\u3066\u306fPC(Python\u30b9\u30af\u30ea\u30d7\u30c8)\u304b\u3089\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067Arduino\u306b\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u53d7\u4fe1 or \u9001\u4fe1\u306e\u30b3\u30de\u30f3\u30c9\u3092\u9001\u4fe1\u3059\u308b\u611f\u3058\u3067\u3059\u3002<br \/>\nArduino\u3067\u53d7\u4fe1\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u30c7\u30fc\u30bf\u3092PC\u306b\u4fdd\u5b58\u3057\u305f\u308a\u3001PC\u306b\u4fdd\u5b58\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u30c7\u30fc\u30bf\u3092Arduino\u306b\u9001\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u3067\u5b66\u7fd2\u30ea\u30e2\u30b3\u30f3\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u307e\u3059\u3002<\/p>\n<h3>\u554f\u984c\u70b9<\/h3>\n<p>\u3067\u307e\u3041\u5b89\u5b9a\u3057\u3066\u52d5\u4f5c\u306f\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u8d64\u5916\u7dda\u4fe1\u53f7\u306e\u751f\u30c7\u30fc\u30bf\u3092\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u3084\u308a\u3068\u308a\u3059\u308b\u306e\u3067\u305d\u306e\u3078\u3093\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u53d7\u4fe1\u3001\u3064\u307e\u308a\u5b66\u7fd2\u306f\u57fa\u672c\u6700\u521d\u306e1\u56de\u3084\u308c\u3070\u6e08\u3080\u306e\u3067\u3042\u307e\u308a\u6c17\u306b\u306a\u3089\u306a\u3044\u3093\u3067\u3059\u3051\u3069\u3082\u3001\u9001\u4fe1\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3068\u7d50\u69cb\u4e0d\u4fbf\u3067\u3059\u3002<br \/>\n\u79c1\u304c\u5b66\u7fd2\u3055\u305b\u305f\u30ea\u30e2\u30b3\u30f3\u306e\u5834\u5408\u3060\u3068\u9001\u4fe1\u306b1\u79d2\u304f\u3089\u3044\u304b\u304b\u308b\u306e\u3067\u3001\u4f8b\u3048\u3070\u30c6\u30ec\u30d3\u306e\u30ea\u30e2\u30b3\u30f3\u306e\u8907\u6570\u306e\u30dc\u30bf\u30f3\u3092\u9023\u7d9a\u3057\u3066\u30d1\u30d1\u30d1\u30c3\u3068\u64cd\u4f5c\u3059\u308b\u3088\u3046\u306a\u5834\u5408\u306e\u30ea\u30a2\u30eb\u30ea\u30e2\u30b3\u30f3\u306e\u4f7f\u3044\u52dd\u624b\u3068\u304f\u3089\u3079\u308b\u3068\u3001\u975e\u5e38\u306b\u4f7f\u3044\u3065\u3089\u3044\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u751f\u30c7\u30fc\u30bf\u3092\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u3084\u308a\u3068\u308a\u3057\u3066\u308b\u306e\u304c\u539f\u56e0\u306a\u306e\u3067\u3001\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3088\u3046\u306b\u3059\u308b\u3068\u89e3\u6c7a\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nIRremote\u306b\u306f\u751f\u30c7\u30fc\u30bf\u3060\u3051\u3067\u306a\u304f\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u4ed5\u7d44\u307f\u3082\u3042\u308b\u306e\u3067\u3001\u3068\u3044\u3046\u304b\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u306e\u304c\u4e3b\u76ee\u7684\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306a\u306e\u3067\u3001\u5bfe\u5fdc\u306f\u305d\u3046\u96e3\u3057\u304f\u306f\u306a\u3044\u306f\u305a\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3068\u3044\u3046\u306e\u306f\u3001\u4f8b\u3048\u3070NEC\u65b9\u5f0f\u306e\u4fe1\u53f7\u306e12345(32bit\u30c7\u30fc\u30bf)\u307f\u305f\u3044\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u5834\u54081\u4fe1\u53f7\u30675\u30d0\u30a4\u30c8\u3042\u308c\u3070\u5341\u5206\u306b\u8868\u73fe\u3067\u304d\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u751f\u30c7\u30fc\u30bf\u3060\u3068\u79c1\u304c\u5b66\u7fd2\u3055\u305b\u305f\u30ea\u30e2\u30b3\u30f3\u306e\u5834\u5408\u30011\u4fe1\u53f7\u3042\u305f\u308a32bit\u6574\u657068\u500b\u5206\u304f\u3089\u3044\u3067\u3001\u5358\u7d14\u8a08\u7b97\u3067272\u30d0\u30a4\u30c8\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30c7\u30b3\u30fc\u30c9\u6e08\u307f\u30c7\u30fc\u30bf\u3068\u6bd4\u3079\u308b\u306850\u500d\u4ee5\u4e0a\u306e\u30b5\u30a4\u30ba\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3055\u3089\u306b\u4eca\u56de\u30c7\u30d0\u30c3\u30b0\u306e\u3057\u3084\u3059\u3055\u3092\u8003\u616e\u3057\u3066\u751f\u30c7\u30fc\u30bf\u3092\u6574\u6570\u3058\u3083\u306a\u304f\u3066\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u6587\u5b57\u5217\u3068\u3057\u3066\u9001\u4fe1\u3057\u3066\u307e\u3059\u306e\u3067300\u30d0\u30a4\u30c8\u4ee5\u4e0a\u306b\u306a\u3063\u3066\u307e\u3059\u3002<br \/>\n\u5404\u6574\u6570\u304c3\uff5e5\u6841\u306b\u53ce\u307e\u3063\u3066\u308b\u306e\u3067\u3053\u306e\u7a0b\u5ea6\u3067\u6e08\u3093\u3067\u307e\u3059\u3051\u3069\u3001\u304b\u306a\u308a\u7121\u99c4\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<p>\u5f8c\u3005\u30c7\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3088\u3046\u5909\u66f4\u3059\u308b\u3068\u3057\u3066\u3001\u73fe\u72b6\u306e\u4ed5\u69d8\u306e\u307e\u307e\u3067\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u901f\u5ea6\u3092\u5909\u3048\u305f\u3089\u3069\u306e\u304f\u3089\u3044\u51e6\u7406\u901f\u5ea6\u306b\u5909\u5316\u304c\u3042\u308b\u304b\u6c17\u306b\u306a\u3063\u305f\u306e\u3067\u6e2c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u8a08\u6e2c\u306b\u4f7f\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n#!\/usr\/bin\/env python\r\n# coding=utf-8\r\n\r\nimport subprocess\r\nimport timeit\r\n\r\n\r\ndef main():\r\n    command = &#x5B;\r\n        'python', 'irecho.py', 'send', '--serial-port', 'COM3', '--name', 'ue',\r\n    ]\r\n    result = timeit.timeit(\r\n        '''subprocess.run(\r\n            command, stdout=subprocess.PIPE, stderr=subprocess.PIPE\r\n        )''',\r\n        'import subprocess',\r\n        number=10,\r\n        globals={'command': command}\r\n    )\r\n    print(result)\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n<\/pre>\n<p>\u9001\u4fe1\u51e6\u7406\u309210\u56de\u884c\u3063\u3066\u305d\u306e\u5408\u8a08\u6642\u9593\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n<ins datetime=\"2016-12-19T12:12:40+00:00\">\u8ffd\u8a18: \u3053\u308c\u6700\u521d\u306eimport subprocess\u306f\u3044\u3089\u306a\u3044\u3067\u3059\u306dw<\/ins><\/p>\n<p>\u3053\u308c\u3092\u5143\u306e\u30bd\u30fc\u30b9\u3092\u66f8\u304d\u63db\u3048\u306a\u304c\u30892400bps\u304b\u3089230400bps\u307e\u3067\u8a08\u6e2c\u3057\u305f\u7d50\u679c\u304c\u4ee5\u4e0b\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png\" alt=\"\" width=\"929\" height=\"422\" class=\"aligncenter size-full wp-image-4845\" srcset=\"https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph.png 929w, https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph-300x136.png 300w, https:\/\/peta.okechan.net\/blog\/wp-content\/uploads\/2016\/12\/baudrategraph-768x349.png 768w\" sizes=\"auto, (max-width: 929px) 100vw, 929px\" \/><\/a><\/p>\n<table>\n<tr>\n<td>2400bps<\/td>\n<td>31.465807555238776\u79d2<\/td>\n<\/tr>\n<tr>\n<td>4800bps<\/td>\n<td>16.709830173437872\u79d2<\/td>\n<\/tr>\n<tr>\n<td>9600bps<\/td>\n<td>10.859490425279164\u79d2<\/td>\n<\/tr>\n<tr>\n<td>14400bps<\/td>\n<td>6.955400712758374\u79d2<\/td>\n<\/tr>\n<tr>\n<td>19200bps<\/td>\n<td>5.69991770016631\u79d2<\/td>\n<\/tr>\n<tr>\n<td>28800bps<\/td>\n<td>4.4919952482775\u79d2<\/td>\n<\/tr>\n<tr>\n<td>38400bps<\/td>\n<td>3.902442195295795\u79d2<\/td>\n<\/tr>\n<tr>\n<td>57600bps<\/td>\n<td>3.2598146828225234\u79d2<\/td>\n<\/tr>\n<tr>\n<td>76800bps<\/td>\n<td>2.9445462580185318\u79d2<\/td>\n<\/tr>\n<tr>\n<td>115200bps<\/td>\n<td>2.5869034925160372\u79d2<\/td>\n<\/tr>\n<tr>\n<td>230400bps<\/td>\n<td>51.266840769779044\u79d2<\/td>\n<\/tr>\n<\/table>\n<p>\u5143\u304c9600bps\u3060\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u308210\u56de\u306e\u9001\u4fe1\u51e6\u7406\u3067\u7d0410\u79d2\u3067\u3084\u306f\u308a1\u56de\u306e\u9001\u4fe1\u51e6\u7406\u3042\u305f\u308a1\u79d2\u304f\u3089\u3044\u304b\u304b\u3063\u3066\u305f\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>\n2400bps\u304b\u308919200bps\u307e\u3067\u306f\u30dc\u30fc\u30ec\u30fc\u30c8\u306b\u5fdc\u3058\u3066\u7d50\u69cb\u901f\u304f\u306a\u308b\u611f\u3058\u3067\u3059\u3051\u3069\u3082\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u4ee5\u5916\u306e\u51e6\u7406\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306e\u4e3b\u8981\u56e0\u306b\u306a\u308a\u306f\u3058\u3081\u308b\u3068\u601d\u308f\u308c\u308b19200bps\u4ee5\u964d\u306f\u3042\u3093\u307e\u308a\u901f\u304f\u306a\u3089\u306a\u3044\u611f\u3058\u3067\u3059\u306d\u3002<br \/>\n230400bps\u3067\u30b0\u30e9\u30d5\u304c\u8df3\u306d\u4e0a\u304c\u3063\u3066\u307e\u3059\u3051\u3069\u3082\u3001\u3053\u308c\u306f\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306b\u5931\u6557\u3057\u3066PC\u5074\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3068Arduino\u304c\u3046\u307e\u304f\u9023\u643a\u51fa\u6765\u306a\u304f\u306a\u308a\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u304c\u767a\u751f\u3059\u308b\u307e\u3067\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u305b\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\nArduino\u5074\u306e\u30bd\u30fc\u30b9\u3067\u9001\u4fe1\u6642\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593\u306f5\u79d2\u3068\u3057\u3066\u307e\u3059\u306e\u3067\u300110\u56de\u306e\u51e6\u7406\u3067\u7d0451\u79d2\u304b\u304b\u3063\u305f\u3068\u3044\u3046\u3053\u3068\u306f10\u56de\u5168\u3066\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u3066\u308b\u3082\u306e\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>115200bps\u304c\u4e00\u756a\u901f\u3044\u3093\u3067\u3059\u3051\u3069\u3082\u901a\u4fe1\u306e\u5b89\u5b9a\u6027\u3068\u3044\u3046\u70b9\u3067\u5c11\u3057\u5fc3\u914d\u306a\u306e\u3067\u3072\u3068\u3064\u4e0b\u306e76800bps\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u601d\u3063\u305f\u3088\u308a\u52b9\u679c\u304c\u9ad8\u304b\u3063\u305f\u306e\u3067\u6839\u672c\u89e3\u6c7a\u3059\u308b\u307e\u3048\u306b\u30dc\u30fc\u30ec\u30fc\u30c8\u3092\u4e0a\u3052\u3066\u3057\u3070\u3089\u304f\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":4852,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[423,60],"class_list":["post-4832","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-arduino","tag-python"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/4832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=4832"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/4832\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media\/4852"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=4832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=4832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=4832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}