
{"id":5217,"date":"2016-11-10T17:45:04","date_gmt":"2016-11-10T08:45:04","guid":{"rendered":"https:\/\/okiraku-camera.tokyo\/blog\/?p=5217"},"modified":"2018-06-27T22:48:52","modified_gmt":"2018-06-27T13:48:52","slug":"arduino-nano%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9f%e8%b5%a4%e5%a4%96%e7%b7%9a%e3%83%aa%e3%83%a2%e3%82%b3%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e3%81%ae%e5%8f%97%e4%bf%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/okiraku-camera.tokyo\/blog\/?p=5217","title":{"rendered":"Arduino nano\u3092\u4f7f\u3063\u305f\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u53d7\u4fe1\u5668"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>\u30a2\u30de\u30be\u30f3\u3067\u8cb7\u3063\u305fArduino nano\u4e92\u63db\u30dc\u30fc\u30c9 (\u5e83\u6771\u7701\u6771\u839e\u5e02\u304b\u3089\u306e\u9001\u6599\u8fbc\u3067320\u5186) \u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u5bb6\u96fb\u7528\u30ea\u30e2\u30b3\u30f3\u306e\u30b3\u30de\u30f3\u30c9\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4854\">\u4ee5\u524d\u4f5c\u3063\u305fESP-WROOM-02\u3092\u4f7f\u3063\u305f\u69cb\u6210<\/a>\u3068\u540c\u69d8\u306e\u3053\u3068\u3092\u3001+5V\u300116MHz\u52d5\u4f5c\u306eATmega328P\u3092\u8f09\u305b\u305fArduino nano\u3067\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u76ee\u6a19\u3002nano\u306b\u306fUSB-\u30b7\u30ea\u30a2\u30eb\u5909\u63db\u30c1\u30c3\u30d7\u3082\u8f09\u3063\u3066\u304a\u308a\u3001\u96fb\u6e90\u3082USB\u7d4c\u7531\u3067\u4e0e\u3048\u3089\u308c\u308b\u306e\u3067\u5c11\u306a\u3044\u90e8\u54c1\u70b9\u6570\u3067\u4f5c\u308c\u308b\u306e\u304c\u3044\u3044\u3068\u3053\u308d\u3060\u308d\u3046\u3002<\/p>\n<p>\u5b9f\u306e\u3068\u3053\u308d\u3001Arduino PRO MINI\u3084ESP-WROOM-02\u306e\u958b\u767a\u6642\u306b\u5fc5\u8981\u306aUSB-\u30b7\u30ea\u30a2\u30eb\u5909\u63db\u30dc\u30fc\u30c9 (AE-FT231X) \u30921\u679a\u3057\u304b\u6301\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u30ea\u30e2\u30b3\u30f3\u306e\u767a\u4fe1\u5074\u3068\u53d7\u4fe1\u5074\u3092\u540c\u6642\u306b\u4f5c\u308b\u3068\u304d\u3001\u3057\u3087\u3046\u3057\u3087\u3046\u4e0d\u4fbf\u3060\u3063\u305f\u305b\u3044\u3082\u3042\u308b\u3002<\/p>\n<h2>Arduino Nano\u4e92\u63db\u30dc\u30fc\u30c9\u306b\u3064\u3044\u3066<\/h2>\n<p>\u4eca\u56de\u4f7f\u3063\u305f\u4e92\u63db\u30dc\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5916\u89b3\u3092\u3057\u3066\u3044\u308b\u3002<\/p>\n<figure id=\"attachment_5224\" aria-describedby=\"caption-attachment-5224\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/ea4fbecbbaee0919927b4c719ea026bc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-5224 size-large\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/ea4fbecbbaee0919927b4c719ea026bc-552x414.jpg\" alt=\"Arduino nano \u4e92\u63db\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-5224\" class=\"wp-caption-text\">Arduino nano \u4e92\u63db\u30dc\u30fc\u30c9<\/figcaption><\/figure>\n<p>\u30df\u30cb\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u3068\u307b\u307c\u540c\u3058\u9577\u3055\u3067\u3001\u5199\u771f\u5de6\u7aef\u306b\u306fUSB miniB\u30b3\u30cd\u30af\u30bf\u3092\u5099\u3048\u3066\u3044\u308b\u3002\u53f3\u5074\u306e6\u30d4\u30f3\u306e\u30dd\u30b9\u30c8\u306fISP(In-System Programmer)\u3092\u5229\u7528\u3059\u308b\u3068\u304d\u306b\u4f7f\u3046SPI\u63a5\u7d9a\u306e\u305f\u3081\u306e\u3082\u306e\u3002\u30d4\u30f3\u30dd\u30b9\u30c8\u306f\u5546\u54c1\u306b\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u81ea\u5206\u3067\u30cf\u30f3\u30c0\u4ed8\u3051\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<figure id=\"attachment_5225\" aria-describedby=\"caption-attachment-5225\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/5db85ed4947b01f7ac928bdae4361c16.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-5225 size-large\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/5db85ed4947b01f7ac928bdae4361c16-552x414.jpg\" alt=\"Arduino nano \u4e92\u63db\u30dc\u30fc\u30c9\u88cf\u9762\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-5225\" class=\"wp-caption-text\">Arduino nano \u4e92\u63db \u88cf\u9762<\/figcaption><\/figure>\n<p>\u88cf\u5074\u306b\u306f\u3001\u5de6\u5074 (USB\u30b3\u30cd\u30af\u30bf\u5074) \u306bUSB-\u30b7\u30ea\u30a2\u30eb\u5909\u63db\u30c1\u30c3\u30d7\u306eCH-340G\u3001\u53f3\u5074\u306b\u306f\u5b9a\u96fb\u5727\u30ec\u30ae\u30e5\u30ec\u30fc\u30bf\u306eAMS1117\u304c\u8f09\u3063\u3066\u3044\u308b\u3002AMS1117\u306e\u4ed5\u69d8\u3067\u306f\u30c9\u30ed\u30c3\u30d7\u30a2\u30a6\u30c8\u304c1V\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001+5V\u3092\u5f97\u308b\u306b\u306f6V\u4ee5\u4e0a\u3092\u4e0e\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u3060\u308d\u3046\u3002\u8868\u5074\u306e\u5de6\u4e0b\u7aef\u3042\u305f\u308a\u306b3V3\u3068\u3044\u3046\u30d4\u30f3\u304c\u51fa\u3066\u3044\u308b\u304c\u3001CH-340G\u304c\u4f9b\u7d66\u3059\u308b+3.3V\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u3002\u6b8b\u5ff5\u306a\u304c\u3089\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u898b\u3066\u3082\u4ed5\u69d8\u304c\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u6d41\u305b\u308b\u96fb\u6d41\u304c\u4e0d\u660e\u3067\u5229\u7528\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>\u3053\u306enano\u3092Windows7 pro\u304c\u52d5\u3044\u3066\u3044\u308bPC\u306b\u3064\u306a\u3050\u3068\u304d\u306b\u306f\u3001<a href=\"http:\/\/www.wch.cn\/download\/CH341SER_ZIP.html\">\u30e1\u30fc\u30ab\u30fc\u30b5\u30a4\u30c8\u304b\u3089CH340G\u306e\u30c9\u30e9\u30a4\u30d0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a>\u3057\u3066\u304d\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3060\u3051\u3069\u3001zip\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306ereadme.txt\u306f\u4e2d\u56fd\u8a9e\u3067\u66f8\u3044\u3066\u3042\u3063\u305f\u3002\u3053\u306e\u3042\u305f\u308a\u3001\u3061\u3087\u3063\u3068\u5f15\u3044\u3066\u3057\u307e\u3046\u4eba\u3082\u3044\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>\u3064\u3044\u3067\u306a\u304c\u3089\u3001nano\u3068PRO MINI (The Simple)\u306e\u4e92\u63db\u30dc\u30fc\u30c9\u3092\u4e26\u3079\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<figure id=\"attachment_5226\" aria-describedby=\"caption-attachment-5226\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/630e53715707cedfd86beaffe78263d9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-5226\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/630e53715707cedfd86beaffe78263d9-552x414.jpg\" alt=\"nano\u3068PRO MINI\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-5226\" class=\"wp-caption-text\">nano\u3068PRO MINI \u3069\u3061\u3089\u3082chinese.<\/figcaption><\/figure>\n<p>USB-\u30b7\u30ea\u30a2\u30eb\u304c\u8f09\u3063\u3066\u3044\u308b\u5206\u3001nano\u306e\u65b9\u304c\u9577\u3044\u3002\u305d\u306e\u5206\u3001\u4e21\u8107\u306b\u30a2\u30ca\u30ed\u30b0\u5165\u529b\u7528\u306e\u30d4\u30f3\u3092\u4f59\u8a08\u306b\u51fa\u305b\u3066\u3044\u308b\u3002<\/p>\n<h2>\u56de\u8def<\/h2>\n<p>\u56de\u8def\u56f3\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3001Arduino nano\u3068<a href=\"http:\/\/akizukidenshi.com\/catalog\/g\/gI-04659\/\">\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u306eOSRB38C9AA<\/a>\u3092\u76f4\u7d50\u3057\u305f\u3060\u3051\u3002\u96fb\u6e90\u306f\u30bb\u30eb\u30d5\u30d1\u30ef\u30fc\u306eUSB\u30cf\u30d6\u304b\u3089\u5f97\u308b\u3053\u3068\u306b\u306a\u308a\u5b9f\u306b\u30b7\u30f3\u30d7\u30eb\u3002<\/p>\n<p><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/A_NANO_IR_RX-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5222\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/A_NANO_IR_RX-1-552x345.png\" alt=\"a_nano_ir_rx-1\" width=\"552\" height=\"345\" \/><\/a><\/p>\n<p>\u3053\u306e\u56de\u8def\u56f3\u3092\u3075\u3064\u3046\u306e\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u4e0a\u3067\u5b9f\u73fe\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<p><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/09243057343d2440606befd61dfb741d.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5231\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/09243057343d2440606befd61dfb741d-552x414.jpg\" alt=\"Arduino nano \u4e92\u63db\u30dc\u30fc\u30c9\u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\" width=\"552\" height=\"414\" \/><\/a><\/p>\n<p>Arduino nano(\u4e92\u63db) \u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb (OSRB38C9AA) \u3068\u914d\u7dda\u7528\u306e\u30ef\u30a4\u30e4\u306e\u307f\u3067\u3042\u308b\u3002\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u4ee3\u3084\u30ef\u30a4\u30e4\u4ee3\u3092\u9664\u3044\u3066370\u5186\u3002<\/p>\n<p>\u3053\u306e\u5199\u771f\u3060\u3051\u306fOlympus Pen mini (E-PM2) \u306b\u3001MZD14-42EZ\u3092\u7740\u3051\u306642mm\u7aef\u3067\u64ae\u5f71\u3002\u624b\u30d6\u30ec\u88dc\u6b63\u6a5f\u80fd\u304c\u5f31\u3044\u306e\u3067\u5353\u4e0a\u4e09\u811a\u3092\u4f7f\u3063\u305f\u304c\u3001\u610f\u5916\u3068\u5bc4\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30b1\u30c3\u30c1<\/h2>\n<p>ESP-WROOM-02\u3067\u52d5\u3044\u3066\u3044\u305f\u30b9\u30b1\u30c3\u30c1\u3092\u6301\u3063\u3066\u304d\u3066\u3001IO\u30d4\u30f3\u306e\u756a\u53f7\u3092\u5909\u3048\u3001\u3068\u308a\u3042\u3048\u305a\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u305f\u3068\u3053\u308d\u3001<\/p>\n<pre class=\"striped:false nums:false lang:default highlight:0 decode:true\">\u6700\u592730,720\u30d0\u30a4\u30c8\u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u30b9\u30b1\u30c3\u30c1\u304c8,790\u30d0\u30a4\u30c8\uff0828%\uff09\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\r\n\u6700\u59272,048\u30d0\u30a4\u30c8\u306eRAM\u306e\u3046\u3061\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u304c7,382\u30d0\u30a4\u30c8\uff08360%\uff09\u3092\u4f7f\u3063\u3066\u3044\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3067-5,334\u30d0\u30a4\u30c8\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/pre>\n<p>\u3068\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3063\u305f\u30025k\u30d0\u30a4\u30c8\u4ee5\u4e0a\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u3044\u3068\u306e\u3053\u3068\u3002<br \/>\nArduino (ATmega328P)\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u4f7f\u3048\u308bRAM\u304c2,048\u30d0\u30a4\u30c8\u3057\u304b\u306a\u3044\u3002\u305d\u308c\u306b\u5bfe\u3057\u3066\u3001ESP8266EX\u3067Arduino Core\u3092\u4f7f\u3046\u3068\u304d\u306b\u306f\u300181,920\u30d0\u30a4\u30c8\u306eRAM\u3092\u5229\u7528\u3067\u304d\u308b\u300280k\u30d0\u30a4\u30c8\u8fd1\u304f\u3082\u5dee\u304c\u3042\u3063\u305f\u3068\u306f\u3002\u5236\u7d04\u304c\u7de9\u3044\u3068\u304d\u306f\u3001\u5927\u3089\u304b\u306b\u5fc3\u306e\u8d74\u304f\u307e\u307e\u306b\uff08\uff1f\uff09\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3057\u307e\u3046\u306e\u3060\u3051\u3069\u3001\u4eca\u56de\u306f\u7bc0\u7d04\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/p>\n<pre class=\"lang:c++ decode:true\" title=\"A_IR_REMOCON_DUMP1\">#include &lt;math.h&gt;\r\n#define START_MSG \"\\n\" + String(__FILE__) + \" start.\"\r\n\r\n#define IR_PIN 4\r\n\/\/ tools\/avr\/avr\/include\/avr\/sfr_defs.h:#define _BV(bit) (1 &lt;&lt; (bit))\r\n#define READ_IR_PIN()  (PIND &amp; B00010000)\r\n\r\n#define OP_LED 13\r\nvoid decode_data(int count);\r\nvoid setup()\r\n{\r\n  delay(100);\r\n  Serial.begin(115200);\r\n  pinMode(IR_PIN, INPUT);\r\n  Serial.println(START_MSG);\r\n  pinMode(OP_LED, OUTPUT);\r\n  digitalWrite(OP_LED, 0);\r\n}\r\n\/\/ OSRB38C9AA\u306f active low\u51fa\u529b\u3002\r\n\/\/  \u6700\u59270.5\u79d2\u9593\u307e\u305f\u306fDATA_COUNT\u500b\u306e\u53d6\u308a\u8fbc\u307f\u3092\u884c\u3046\u3002\u53d6\u308a\u8fbc\u307f\u5f8c\u306b\u89e3\u6790\u3057\u3066\u30c7\u30b3\u30fc\u30c9\u3057\u3001\u30b3\u30fc\u30c9\u5217\u3092\u51fa\u529b\u3059\u308b\u3002\r\n\r\ntypedef struct {\r\n  unsigned short  high;  \/\/ H\u671f\u9593\u306eusec\r\n  unsigned short  low;   \/\/ L\u671f\u9593\u306eusec\r\n} irdata_t;\r\n\r\n#define AEHA_T  425\r\n#define NEC_T 560\r\n#define UNKNOWN_T 500\r\n\r\n#define DATA_COUNT  330\r\nirdata_t irdata[DATA_COUNT];\r\nunsigned short t_length;\r\n\r\n\/\/ OSRB38C9AA\u306f active low\u51fa\u529b\u3002\r\nvoid loop()\r\n{\r\n  int data_count = 0;\r\n  unsigned long start_H;\r\n  unsigned long start_L;\r\n  \r\n  int state = READ_IR_PIN();\r\n  unsigned long first_time = micros();\r\n  if (!state) { \/\/ \u6700\u521d\u306e\u7acb\u4e0b\u308a\u691c\u51fa\r\n    int last_state = 0;\r\n    data_count = 0;\r\n    start_H = first_time;\r\n    while(data_count &lt; DATA_COUNT) { \r\n      unsigned long now = micros();  \r\n      if (now &lt; first_time) {\r\n        data_count = 0;\r\n        break;\r\n      }\r\n      if (now - first_time &gt; 500000L)\r\n        break;  \/\/ 500msec\u7d4c\u904e\u3057\u305f\u3089\u3084\u3081\u3002\r\n      state = READ_IR_PIN();\r\n      if (state == last_state)\r\n        continue;\r\n      last_state = state;\r\n      if (!state) {\r\n        irdata[data_count++].low = now - start_L;\r\n        start_H = now;\r\n      } else {\r\n        irdata[data_count].high = now - start_H;\r\n        start_L = now;\r\n      }\r\n    }\r\n    \/\/ \u691c\u51fa\u7d42\u4e86\r\n    if (data_count &gt; 23) {\r\n      \/\/ H\u671f\u9593\u306e\u9577\u3055\u306b\u3088\u308a\u3001T\u5024\u3092\u6c7a\u3081\u308b\u3002\r\n      \/\/ \u6700\u521d\u306e20\u500b\u306eH\u671f\u9593\u306e\u9577\u3055\u304c\u3001\u6a19\u6e96T\u5024\u306e\u8fd1\u508d\u306b\u53ce\u307e\u3063\u3066\u3044\u308b\u6570\u304c10\u500b\u4ee5\u4e0a\u304b\u3069\u3046\u304b\u3002\r\n      int i;\r\n      int m = 0;\r\n      int nec = 0;\r\n      int aeha = 0;\r\n      for(i = 0; i &lt; data_count - 1; i++) {\r\n        if (i &lt; 20) {\r\n          int high = irdata[i].high;\r\n          if (high &gt; 800)\r\n              continue;\r\n          if (abs(high - AEHA_T) &lt;= AEHA_T * 0.18)\r\n            aeha++;\r\n          if (abs(high - NEC_T) &lt;= NEC_T * 0.15)\r\n            nec++; \r\n        }\r\n      }\r\n      t_length = UNKNOWN_T; \/\/ \u3069\u3061\u3089\u3067\u3082\u306a\u3044\u3002\u9069\u5f53\u306a\u5024\r\n      if (aeha &gt; 10 &amp;&amp; aeha &gt; nec)\r\n        t_length = AEHA_T;\r\n      else if (nec &gt; 10 &amp;&amp; nec &gt; aeha)\r\n        t_length = NEC_T;\r\n       Serial.println(\"use T = \" + String(t_length) + \" usec.\");\r\n       decode_data(data_count);\r\n      }\r\n    }\r\n}\r\n\r\n\/\/ index\u306f\u30c7\u30fc\u30bf\u6570\u306e\u7bc4\u56f2\u5185\u3067\u3042\u308b\u3053\u3068\u3002\r\nvoid calc_t(int index, int&amp; high, int&amp; low) {\r\n  high = (int) round((float)irdata[index].high \/ t_length);\r\n  low = (int) round((float)irdata[index].low \/ t_length);\r\n}\r\n\r\nbool isLeader(int high, int low) {\r\n  if ((t_length == AEHA_T &amp;&amp; high == 8 &amp;&amp; low == 4) ||\r\n      (t_length == NEC_T &amp;&amp; high == 16 &amp;&amp; low == 8))  \/\/ \u30ea\u30fc\u30c0\u30fc\u691c\u51fa\r\n    return true;\r\n  return false;        \r\n}\r\n\r\nbool isTrailer(int index) {\r\n  if (irdata[index].low &gt; 8000) \r\n    return true;\r\n  return false;  \r\n}\r\n\r\nbyte get_bit(int high, int low) {\r\n  byte value = 0;\r\n  if (high == 1 &amp;&amp; low == 3)\r\n    value = 1;\r\n  return value;      \r\n}\r\n\r\nstatic const char str_mark[] = \"\\n-----\";\r\nvoid dump_all(int total) {\r\n  int i;\r\n  int high_T, low_T;\r\n  \r\n  for(i = 0; i &lt; total; i++) {\r\n    char tmp[64];\r\n    calc_t(i, high_T, low_T);\r\n    byte val = get_bit(high_T, low_T);\r\n    sprintf(tmp, \"%d : high = %u, low = %u, T:%u, %u, bit=%d\", i + 1, irdata[i].high, irdata[i].low, high_T, low_T, val);\r\n    Serial.println(tmp);\r\n    if (isLeader(high_T, low_T))\r\n      Serial.println(str_mark);\r\n    else if (isTrailer(i))    \r\n      Serial.println(str_mark);\r\n    delay(1);\r\n  }\r\n}\r\n\r\nvoid decode_data(int total) {\r\n    bool in_frame = false;\r\n    int index = 0;\r\n    int high_T, low_T;\r\n\r\n    if (total == 0)\r\n      return;\r\n\r\n    dump_all(total);\r\n    Serial.println(str_mark); \r\n    while (index &lt; total) {\r\n      delay(1);\r\n      calc_t(index, high_T, low_T);\r\n      if (!in_frame &amp;&amp; isLeader(high_T, low_T)) {\r\n        in_frame = true;\r\n        index++;\r\n        continue;\r\n      }\r\n      if (!in_frame) {\r\n        index++;\r\n        continue;\r\n      }\r\n      if (isTrailer(index)) {\r\n        index++;\r\n        in_frame = false;\r\n        Serial.println(str_mark);  \r\n        continue;\r\n      }\r\n      if (total - index &lt; 8)  \/\/ \u30d0\u30a4\u30c8\u306b\u306a\u3089\u306a\u3044\u3002\r\n        break;\r\n      byte cur = 0;\r\n      for(int i = 0; i &lt; 8; i++) {\r\n        calc_t(index, high_T, low_T);\r\n        byte value = get_bit(high_T, low_T);\r\n        cur = cur &gt;&gt; 1 | (value ? 0x80 : 0);       \r\n        index++;\r\n      }\r\n      char tmp[6];\r\n      sprintf(tmp, \"%02x \", cur);\r\n      Serial.print(tmp);  \r\n    }\r\n    Serial.println(str_mark);  \r\n}\r\n<\/pre>\n<h6>\u30b9\u30b1\u30c3\u30c1\u306b\u3064\u3044\u3066<\/h6>\n<p>\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306e\u4fe1\u53f7\u3084\u30c7\u30fc\u30bf\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4854\">\u4ee5\u524d\u306e\u6295\u7a3f<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h4>\u30d7\u30ed\u30b0\u30e9\u30e0\u69cb\u9020\u3084\u30c7\u30fc\u30bf\u306e\u6301\u3061\u65b9<\/h4>\n<p>setup()\u3067\u521d\u671f\u5316\u3057\u305f\u5f8c\u306f\u3001loop()\u3067\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u51fa\u529b\u306e\u53d6\u308a\u8fbc\u307f\u3001\u53d6\u308a\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u306e\u89e3\u6790\u3068\u30b3\u30de\u30f3\u30c9\u30c7\u30fc\u30bf\u3078\u306e\u30c7\u30b3\u30fc\u30c9\u3092\u884c\u3063\u3066\u304a\u308a\u3001\u5927\u304d\u306a\u6d41\u308c\u306f\u4ee5\u524d\u306e\u3082\u306e\u3068\u540c\u3058\u3002\u305f\u3060\u3001\u4f7f\u7528\u3059\u308b\u30e1\u30e2\u30ea\u3092\u6e1b\u3089\u3059\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u53d6\u308a\u8fbc\u3093\u3060\u5185\u5bb9\u3092\u4fdd\u6301\u3057\u305f\u308a\u3001\u30c7\u30b3\u30fc\u30c9\u306e\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306e\u69cb\u9020\u4f53\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3057\u305f\u3002<\/p>\n<pre class=\"nums:false lang:default decode:true\">typedef struct {\r\n  long  high;   \/\/ \u2193\u9077\u79fb\u691c\u51fa\u30bf\u30a4\u30df\u30f3\u30b0\r\n  long  low;   \/\/ \u2191\u9077\u79fb\u691c\u51fa\u30bf\u30a4\u30df\u30f3\u30b0\r\n  int high_T; \/\/ H\u6301\u7d9a\u6642\u9593\uff08usec)\r\n  int low_T; \/\/ L\u6301\u7d9a\u6642\u9593\uff08usec)\r\n  int value;  \/\/ \u8ad6\u7406\u5024 : 0 or 1\r\n} irdata_t;\r\n<\/pre>\n<p>\u4ee5\u524d\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306a\u5177\u5408\u3067\u8d05\u6ca2\u306b\u3044\u308d\u3044\u308d\u3068\u8a70\u3081\u8fbc\u3093\u3067\u3044\u305f\u3002\u3053\u306e\u69cb\u9020\u4f53\u3092\u8981\u7d20\u3068\u3057\u3066\u3082\u3064\u914d\u5217\u304c\u30c7\u30ab\u30a4\u306e\u3067\u3001\u8981\u7d20\u30b5\u30a4\u30ba\u3092\u7e2e\u3081\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<pre class=\"nums:false lang:default decode:true\">typedef struct {\r\n  unsigned short  high;  \/\/ H\u671f\u9593\u306eusec\r\n  unsigned short  low;   \/\/ L\u671f\u9593\u306eusec\r\n} irdata_t;\r\n<\/pre>\n<p>\u4eca\u56de\u306f\u3053\u308c\u3060\u3051\u3002long\u3084int\u304c4\u30d0\u30a4\u30c8\u3001short\u304c2\u30d0\u30a4\u30c8\u306a\u306e\u3067\u3001\u4ee5\u524d\u306f1\u8981\u7d20\u3042\u308a\u305f20\u30d0\u30a4\u30c8\u3060\u3063\u305f\u3082\u306e\u30924\u30d0\u30a4\u30c8\u306b\u3057\u305f\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u8fbc\u3080\u969b\u306b\u306f\u3001\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u304cH\u3060\u3063\u305f\u9577\u3055\u3068L\u3060\u3063\u305f\u9577\u3055\u3092\u89e3\u91c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001micros()\u306b\u3088\u3063\u3066\u958b\u59cb\u304b\u3089\u306e\u6642\u9593\u3092\u5f97\u3066\u3044\u308b\u3002\u4ee5\u524d\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306fmicros()\u306e\u8fd4\u3059\u5024\u81ea\u4f53\u3092\u8a18\u61b6\u3057\u3001\u53d6\u8fbc\u307f\u7d42\u4e86\u5f8c\u306bH\u671f\u9593\u3001L\u671f\u9593\u306b\u76f4\u3057\u3066\u3044\u305f\u306e\u3060\u3051\u3069\u3001\u4eca\u56de\u306f\u53d6\u308a\u8fbc\u307f\u306e\u30eb\u30fc\u30d7\u5185 \uff0848\u884c\u76ee\u306ewhile()\u30eb\u30fc\u30d7 \uff09\u3067\u305d\u308c\u305e\u308c\u306e\u03bc\u79d2\u6570\u3092\u914d\u5217\u306b\u683c\u7d0d\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u307e\u305f\u3001H\u671f\u9593\u3084L\u671f\u9593\u306eT\u5024\u3078\u306e\u5909\u63db\u3084\u8ad6\u7406\u5024\uff08\u30d3\u30c3\u30c8\u5024\uff09\u3078\u306e\u5909\u63db\u3082\u3001\u53d6\u308a\u8fbc\u307f\u306e\u5f8c\u306b\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u884c\u3046\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3001\u4ee5\u524d\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306f\u914d\u5217\u306e\u8981\u7d20\u6570 (DATA_COUNT) \u3092500\u3068\u3057\u3066\u3044\u305f\u304c\u3001500\u00d74=2000 \u3067\u306f\u30ea\u30df\u30c3\u30c8\u306b\u9054\u3057\u3066\u3057\u307e\u3046\u305f\u3081\u5c11\u306a\u304f\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u3092\u4eca\u56de\u306e\u3088\u3046\u306a\u5177\u5408\u3067\u683c\u7d0d\u3059\u308b\u5834\u5408\u3001\u914d\u5217\u306e1\u8981\u7d20\u304c1bit\u306b\u76f8\u5f53\u3059\u308b\u306e\u3067\u3001\u8981\u7d20\u6570\u304c320\u306740\u30d0\u30a4\u30c8\u5206\u306e\u30c7\u30fc\u30bf\u304c\u53d6\u308a\u8fbc\u3081\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u30ea\u30fc\u30c0\u30fc\u3084\u30c8\u30ec\u30fc\u30e9\u30fc\u3001\u30b4\u30df\u306a\u3069\u3092\u8003\u616e\u3057\u3066330\u3068\u3057\u305f\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u53d6\u308a\u8fbc\u307f\u7528\u306e\u914d\u5217 ( <em>irdata[DATA_COUNT]<\/em> ) \u30671320\u30d0\u30a4\u30c8\u6d88\u8cbb\u3059\u308b\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30b9\u30b1\u30c3\u30c1\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u307f\u308b\u3068\u3001<\/p>\n<pre class=\"nums:false lang:default highlight:0 decode:true\">\u6700\u592730,720\u30d0\u30a4\u30c8\u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u30b9\u30b1\u30c3\u30c1\u304c8,298\u30d0\u30a4\u30c8\uff0827%\uff09\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\r\n\u6700\u59272,048\u30d0\u30a4\u30c8\u306eRAM\u306e\u3046\u3061\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u304c1,672\u30d0\u30a4\u30c8\uff0881%\uff09\u3092\u4f7f\u3063\u3066\u3044\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3067376\u30d0\u30a4\u30c8\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\r\n\u30b9\u30b1\u30c3\u30c1\u304c\u4f7f\u7528\u3067\u304d\u308b\u30e1\u30e2\u30ea\u304c\u5c11\u306a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u52d5\u4f5c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/pre>\n<p>\u3068\u8868\u793a\u3055\u308c\u305f\u3002\u53d6\u308a\u8fbc\u307f\u7528\u914d\u5217\u4ee5\u5916\u306e1672 &#8211; 1320 = 352\u30d0\u30a4\u30c8\u306f\u3001\u4ed6\u306e\u5909\u6570\u3084\u6587\u5b57\u5217\u5b9a\u6570\u304c\u4f7f\u3063\u3066\u304a\u308a\u3001\u305d\u306e\u4e2d\u3067\u3082Serial \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7d50\u69cb\u4f7f\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3002<br \/>\n\u300c\u52d5\u4f5c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u300d\u306b\u3064\u3044\u3066\u306f\u3001\u52d5\u304b\u3057\u3066\u307f\u3066\u3001\u3055\u307b\u3069\u554f\u984c\u306a\u3055\u305d\u3046\u306a\u306e\u3067\u7121\u8996\u3057\u3066\u3044\u308b\u3002<\/p>\n<h4>\u5c11\u3005\u306e\u9ad8\u901f\u5316<\/h4>\n<p>\u4ee5\u524d\u306floop() \u306e\u6700\u5f8c\u306b\u4f55\u6c17\u306a\u304f\u00a0delay(1); \u3068\u7f6e\u3044\u3066\u3044\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u6700\u521d\u306b\u51fa\u3059\u7acb\u4e0b\u308a\u30a8\u30c3\u30b8\u306e\u691c\u51fa\u306b\u9045\u308c\u304c\u751f\u3058\u3066\u3057\u307e\u3044\u3001\u6700\u521d\u306e\u30ea\u30fc\u30c0\u30fc\u306e\u691c\u51fa\u306b\u5931\u6557\u3057\u305f\u308a\u3057\u3066\u3044\u305f\u304c\u3001delay()\u3092\u9664\u53bb\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3002<\/p>\n<p>\u307e\u305f\u3001\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u51fa\u529b\u3092\u63a5\u7d9a\u3057\u305fD4\u30d4\u30f3\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f\u306b\u3064\u3044\u3066\u3082\u3001<em>digitalRead(4);<\/em> \u3067\u306f\u306a\u304f\u3001(PIND &amp; B00010000) \u3068\u3057\u305f\u3002\u5f97\u3089\u308c\u308b\u5024\u304c0\u304b1\u304b\u3067\u306f\u306a\u304f\u30010\u304b16\u304b\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u304c\u3001I\/O\u30ec\u30b8\u30b9\u30bf\u304b\u3089\u76f4\u63a5\u8aad\u307f\u51fa\u3059\u3088\u3046\u306b\u3057\u305f\u3002\u4eca\u56de\u306e\u3088\u3046\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u3053\u3067\u9811\u5f35\u3063\u3066\u3082\u5927\u3057\u305f\u9055\u3044\u306f\u306a\u3055\u305d\u3046\u306a\u6c17\u3082\u3059\u308b\u304c\u3002<\/p>\n<h4>\u95a2\u6570\u306e\u5206\u5272<\/h4>\n<p>\u5927\u5143\u306e\u914d\u5217\u304c\u3082\u3064\u60c5\u5831\u304c\u6e1b\u3063\u305f\u306e\u3067\u3001\u3044\u304f\u3064\u304b\u306e\u51e6\u7406\u3092\u95a2\u6570\u3068\u3057\u3001\u53d7\u4fe1\u30c7\u30fc\u30bf\u306e\u30c0\u30f3\u30d7\u6642\u3084\u6700\u7d42\u7684\u306a\u30b3\u30de\u30f3\u30c9\u30c7\u30fc\u30bf\u306e\u53d6\u5f97\u6642\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<ul>\n<li><em>void calc_t()<\/em> \u306f\u3001\u53d7\u4fe1\u30c7\u30fc\u30bf\u5185\u306e\u6307\u5b9a\u306e\u914d\u5217\u8981\u7d20\u304c\u3082\u3064H\u671f\u9593\u3001L\u671f\u9593\u306e\u5024\u3092T\u5024\u306b\u5909\u63db\u3059\u308b\u3002<\/li>\n<li><em>bool isLeader()<\/em> \u306f\u3001T\u5024\u306b\u5909\u63db\u6e08\u306e\u30c7\u30fc\u30bf\uff08\u30aa\u30f3\u671f\u9593\u304a\u3088\u3073\u30aa\u30d5\u671f\u9593\uff09\u304b\u3089\u3001\u305d\u308c\u304c\u30ea\u30fc\u30c0\u30fc\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u3002<\/li>\n<li><em>bool isTrailer()<\/em> \u306f\u3001\u53d7\u4fe1\u30c7\u30fc\u30bf\u5185\u306e\u6307\u5b9a\u306e\u914d\u5217\u8981\u7d20\u304c\u3082\u3064L\u671f\u9593\u304b\u3089\u30c8\u30ec\u30fc\u30e9\u30fc\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u3002\u306a\u304a\u3001\u30c8\u30ec\u30fc\u30e9\u30fc\u304c\u898f\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u3001AEHA\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u307f\u3002<\/li>\n<li><em>byte get_bit()<\/em> \u306f\u3001T\u5024\u306b\u5909\u63db\u6e08\u306e\u30c7\u30fc\u30bf\u304b\u3089\u3001\u8ad6\u7406\u5024\u306b\u5909\u63db\u3057\u3066\u8fd4\u3059\u30021T\u30aa\u30f3\u30673T\u30aa\u30d5\u306a\u3089\u30701\u3067\u3001\u305d\u308c\u4ee5\u5916\u306f0\u3068\u3057\u3066\u3044\u308b\u3002<br \/>\n\u4f8b\u3048\u30701T\u30aa\u30f3\u30672T\u30aa\u30d5\u3068\u3044\u3063\u305f\u53d7\u4fe1\u30c7\u30fc\u30bf\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u7d50\u679c\u3092\u4fe1\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001void dump_all() \u304c\u51fa\u529b\u3059\u308b\u53d7\u4fe1\u5185\u5bb9\u3068\u898b\u6bd4\u3079\u308b\u5fc5\u8981\u304c\u3042\u308b\u3060\u308d\u3046\u3002<\/li>\n<\/ul>\n<h2>\u304d\u3087\u3046\u306e\u307e\u3068\u3081<\/h2>\n<ul>\n<li>\u5f97\u3089\u308c\u308b\u7d50\u679c\uff08\u5404\u30ea\u30e2\u30b3\u30f3\u306e\u30b3\u30de\u30f3\u30c9\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\uff09\u306f\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4854\">\u524d\u56de<\/a>\u3068\u540c\u69d8\u306a\u306e\u3067\u7701\u7565\u3059\u308b\u3002\u305f\u3060\u3001\u96fb\u6a5f\u5927\u624bH\u793e\u306e\u30a8\u30a2\u30b3\u30f3\u7528\u30ea\u30e2\u30b3\u30f3\u306f52\u30d0\u30a4\u30c8\u306e\u30b3\u30de\u30f3\u30c9\u30c7\u30fc\u30bf\u3092\u51fa\u3057\u3066\u304f\u308b\u306e\u3067\u3001\u3053\u306e\u69cb\u6210\u3067\u306f\u7121\u7406\u3002\u30a8\u30a2\u30b3\u30f3\u5927\u624b\u306eD\u793e\u306e\u30ea\u30e2\u30b3\u30f3\u306b\u3064\u3044\u3066\u306f39\u30d0\u30a4\u30c8\u306a\u306e\u3067\u89e3\u6790\u53ef\u80fd\u3060\u3063\u305f\u3002<\/li>\n<li>\u540c\u3058\u7d50\u679c\u3092\u5f97\u308b\u305f\u3081\u306b\u30b9\u30b1\u30c3\u30c1\u306e\u66f8\u304d\u76f4\u3057\u304c\u5fc5\u8981\u306b\u306a\u3063\u305f\u304c\u3001\u4ee5\u524d\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u6210\u3067\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u89e3\u6790\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001Arduino IDE\u3092\u4ed5\u8fbc\u3093\u3060\u30ce\u30fc\u30c8PC\u3068\u5171\u306b\u5916\u306b\u6301\u3061\u51fa\u3059\u3053\u3068\u3082\u8003\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/li>\n<li><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4800\">ESP-WROOM-02\u3068IrLED\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u5bb6\u96fb\u30ea\u30e2\u30b3\u30f3\u306e\u30d5\u30ea\u3092\u3059\u308b\u6a5f\u80fd<\/a>\u306f\u65e2\u306b\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u30d2\u30de\u304c\u3042\u308c\u3070\u3001\u74b0\u5883\u30c7\u30fc\u30bf\uff08\u6e29\u5ea6\u3001\u6e7f\u5ea6\uff09\u3084\u6642\u523b\u306b\u5fdc\u3058\u3066\u30a8\u30a2\u30b3\u30f3\u3084\u7167\u660e\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u4ed5\u7d44\u307f\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u3066\u3044\u308b\u3002<\/li>\n<li>\u300c<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=5032\">ESP-WROOM-02\u3068BME280 \u96fb\u6c60\u99c6\u52d5\u3067\u6e29\u5ea6\uff0f\u6e7f\u5ea6\uff0f\u6c17\u5727\u6e2c\u5b9a<\/a>\u300d\u3068\u3044\u3046\u8a71\u304c\u9014\u4e2d\u306b\u306a\u3063\u3066\u3044\u308b\u304c\u3001\u4f55\u304b\u52d8\u9055\u3044\u304c\u3042\u308b\u306e\u304b\u3001\u3042\u308b\u3044\u306f\u5fc5\u7136\u306a\u306e\u304b\u3001\u601d\u3063\u3066\u3044\u305f\u4ee5\u4e0a\u306b\u65e9\u304f\u96fb\u6c60\u304c\u6d88\u8017\u3057\u305f\u3002\u3053\u308c\u3082\u77e5\u898b\u306e\u4e00\u3064\u306b\u306a\u308b\u306e\u3067\u8fd1\u3005\u306b\u307e\u3068\u3081\u308b\u4e88\u5b9a\u3067\u3059\u3002<\/li>\n<\/ul>\n<h1>\u8ffd\u8a18(\u30df\u30cb\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u7248)<\/h1>\n<p>Arduino nano\u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3057\u304b\u90e8\u54c1\u304c\u5fc5\u8981\u306a\u3044\u306e\u3067\u3001\u66f4\u306b\u5c0f\u3055\u3044\u30df\u30cb\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u306b\u8f09\u305b\u308b\u3053\u3068\u306b\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u306b\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8f09\u305b\u308b\u5834\u6240\u3092\u3061\u3087\u3063\u3068\u5909\u66f4\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56de\u8def\u306b\u3057\u305f\u3002<\/p>\n<figure id=\"attachment_7437\" aria-describedby=\"caption-attachment-7437\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/A_NANO_IR_RX-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7437\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/A_NANO_IR_RX-2-552x394.png\" alt=\"\" width=\"552\" height=\"394\" \/><\/a><figcaption id=\"caption-attachment-7437\" class=\"wp-caption-text\">A_NANO_IR_RX-2<\/figcaption><\/figure>\n<p>\u30b9\u30b1\u30c3\u30c1\u5074\u306f\u3001\u8aad\u307f\u53d6\u308a\u306e\u305f\u3081\u306e\u30dd\u30fc\u30c8\u5b9a\u7fa9\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u6700\u521d\u306e\u65b9\u306b\u3042\u308b2\u884c\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u305f\u3002<\/p>\n<pre class=\"nums:false lang:default decode:true\">#define IR_PIN 4\r\n#define READ_IR_PIN()  (PIND &amp; B00010000)<\/pre>\n<p>\u3068\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u3092\u3001<\/p>\n<pre class=\"nums:false lang:default decode:true\">#define IR_PIN 2\r\n#define READ_IR_PIN()  (PIND &amp; B00000100)\r\n<\/pre>\n<p>\u3068\u3057\u305f\u3002<\/p>\n<figure id=\"attachment_6363\" aria-describedby=\"caption-attachment-6363\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/09\/0a5becaeb9b155eebbbaf44337c8513a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6363\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/09\/0a5becaeb9b155eebbbaf44337c8513a-552x414.jpg\" alt=\"Arduno Nano\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-6363\" class=\"wp-caption-text\">\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u9053\u5177<\/figcaption><\/figure>\n<p>\u30b8\u30e3\u30f3\u30d1\u30ef\u30a4\u30e4\u3082Arduino nano\u306e+5V\u3092\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5411\u304b\u3063\u3066\u53f3\u5074\u306e\u8db3\u306b\u63a5\u7d9a\u3059\u308b\u3060\u3051\u3067\u6e08\u3080(\u5199\u771f\u3067\u306f\u898b\u3048\u307e\u305b\u3093\u304c)\u3002\u3057\u3070\u3057\u3070\u6d3b\u8e8d\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<h6>NEC\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30ea\u30d4\u30fc\u30c8\u306b\u5bfe\u5fdc<\/h6>\n<p>\u3046\u3061\u306b\u3042\u3063\u305f\u3001\u30ea\u30d4\u30fc\u30c8\u51fa\u529b\u3092\u884c\u3046\u30ea\u30e2\u30b3\u30f3\u306b\u5bfe\u5fdc\u3057\u305f\u3002\u5909\u66f4\u7b87\u6240\u304c\u591a\u304f\u306a\u3063\u305f\u306e\u3067<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?page_id=7524\" target=\"_blank\" rel=\"noopener\">\u3001\u5225\u30da\u30fc\u30b8\u306b\u6539\u8a02\u3057\u305f\u30b9\u30b1\u30c3\u30c1\u3092\u63b2\u8f09<\/a>\u3057\u307e\u3057\u305f\u3002\u30ea\u30d4\u30fc\u30c8\u51fa\u529b\u6642\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306a\u3069\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4854\" target=\"_blank\" rel=\"noopener\">WROOM-02\u3092\u4f7f\u3063\u305f\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306e\u8abf\u67fb<\/a> \u306b\u8ffd\u52a0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u30a2\u30de\u30be\u30f3\u3067\u8cb7\u3063\u305fArduino nano\u4e92\u63db\u30dc\u30fc\u30c9 (\u5e83\u6771\u7701\u6771\u839e\u5e02\u304b\u3089\u306e\u9001\u6599\u8fbc\u3067320\u5186) \u3068\u8d64\u5916\u7dda\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u5bb6\u96fb\u7528\u30ea\u30e2\u30b3\u30f3\u306e\u30b3\u30de\u30f3\u30c9\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002 \u4ee5\u524d\u4f5c\u3063\u305fESP-WROOM &hellip; <a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=5217\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Arduino nano\u3092\u4f7f\u3063\u305f\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u53d7\u4fe1\u5668<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[65,86],"class_list":["post-5217","post","type-post","status-publish","format-standard","hentry","category-programming","tag-arduino","tag-remocon"],"_links":{"self":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5217"}],"version-history":[{"count":0,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5217\/revisions"}],"wp:attachment":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}