
{"id":7567,"date":"2018-07-09T17:50:18","date_gmt":"2018-07-09T08:50:18","guid":{"rendered":"https:\/\/okiraku-camera.tokyo\/blog\/?p=7567"},"modified":"2018-09-09T08:32:01","modified_gmt":"2018-09-08T23:32:01","slug":"attiny85-45-%e3%83%94%e3%83%b3%e3%83%81%e3%82%a7%e3%83%b3%e3%82%b8%e5%89%b2%e8%be%bc%e3%81%bf%e3%80%81%e3%82%a2%e3%83%8a%e3%83%ad%e3%82%b0%e5%bc%8f%e3%82%ad%e3%83%bc%e8%ad%98%e5%88%a5%e3%80%81","status":"publish","type":"post","link":"https:\/\/okiraku-camera.tokyo\/blog\/?p=7567","title":{"rendered":"ATtiny85\/45 \u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f\u3001\u30a2\u30ca\u30ed\u30b0\u5f0f\u30ad\u30fc\u8b58\u5225\u3001\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7"},"content":{"rendered":"<h1>\u6982\u8981<\/h1>\n<p>ATtiny85\/45\u3092\u4f7f\u3063\u3066\u5bb6\u96fb\u7528\u306e\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u3092\u4f5c\u308b\u306b\u3042\u305f\u3063\u3066\u4ee5\u4e0b\u3092\u8a66\u3057\u3066\u307f\u305f\u3002<\/p>\n<figure id=\"attachment_7592\" aria-describedby=\"caption-attachment-7592\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/598521a8298e2d337710708210be9bbc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7592\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/598521a8298e2d337710708210be9bbc-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-7592\" class=\"wp-caption-text\">ATtiny45V<\/figcaption><\/figure>\n<ol>\n<li><strong>\u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f\u3067\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3059\u308b\u3002<\/strong><\/li>\n<li><strong>\u62b5\u6297\u5206\u5727\u3068A\/D\u30b3\u30f3\u30d0\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3001\u62bc\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u3092\u8b58\u5225\u3059\u308b\u3002<\/strong><\/li>\n<li><strong>Arduino\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4e00\u5207\u30ea\u30f3\u30af\u3057\u306a\u3044\u3002<\/strong><\/li>\n<li><strong>\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u3082\u4f7f\u3063\u3066\u307f\u308b\u3002<\/strong><\/li>\n<li><strong>\u78ba\u8a8d\u7528\u306e\u30c7\u30fc\u30bf\u9001\u4fe1\u306f\u8d64\u5916\u7dda\u3067\u884c\u3046\u3002<\/strong><\/li>\n<\/ol>\n<p>\u3053\u308c\u3089\u3092\u7d44\u307f\u5408\u308f\u305b\u3001\u62bc\u4e0b\u3055\u308c\u305f\u30b9\u30a4\u30c3\u30c1\u306e\u756a\u53f7\u306a\u3069\u3092\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u3068\u540c\u3058\u3084\u308a\u65b9\u3067\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=5217\" target=\"_blank\" rel=\"noopener\">\u53d7\u4fe1\u5074\u306f\u4ee5\u524d\u4f5c\u3063\u305fArduino nano\u3092\u4f7f\u3063\u305f\u4ed5\u7d44\u307f<\/a>\u3092\u5229\u7528\u3057\u305f\u306e\u3067\u3001\u4eca\u56de\u306e\u30dc\u30fc\u30c9\u304c\u51fa\u529b\u3059\u308b\u30c7\u30fc\u30bf\u306fPC\u4e0a\u306e\u30b7\u30ea\u30a2\u30eb\u7aef\u672b\u306b\u8868\u793a\u3055\u308c\u308b\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\">\u8d64\u5916\u7dda\u53d7\u4fe1\u5074 (Arduino nano +\u00a0OSRB38C9AA)<\/figcaption><\/figure>\n<h2>\u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f\u306b\u3088\u308b\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u306e\u5fa9\u5e30<\/h2>\n<p>ATtiny5\u30b7\u30ea\u30fc\u30ba\u306f\u3001\u4ed6\u306eAVR\u30de\u30a4\u30b3\u30f3\u3068\u540c\u69d8\u306b\u307b\u3068\u3093\u3069\u306e\u6a5f\u80fd(\u30af\u30ed\u30c3\u30af)\u3092\u505c\u6b62\u3059\u308b\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u3092\u5099\u3048\u3066\u3044\u308b\u3002\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u4e2d\u306e\u6d88\u8cbb\u96fb\u6d41\u306f\u3001VCC=3.3V\u4ee5\u4e0b\u306a\u3089\u30700.2\u03bcA\u307e\u305f\u306f\u305d\u308c\u4ee5\u4e0b\u306b\u306a\u308b\u3002\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306b\u3059\u308b\u3068\u304d\u306f\u3001\u30b3\u30a4\u30f3\u96fb\u6c60(CR2032\u306a\u3069)\u3067\u306e\u99c6\u52d5\u3092\u8003\u3048\u3066\u3044\u308b\u304b\u3089\u3053\u306e\u4f4e\u6d88\u8cbb\u96fb\u529b\u6027\u80fd\u306f\u983c\u3082\u3057\u3044\u3002<\/p>\n<p>\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u5916\u90e8\u304b\u3089\u4f55\u3089\u304b\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u4e0e\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u304c\u3001\u4eca\u56de\u306f\u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f(<em>PCI : Pin Change Interrupt<\/em>)\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002PCI\u306f\u3001<span style=\"text-decoration: underline;\">\u30dd\u30fc\u30c8\u30d4\u30f3\u306e\u72b6\u614b(\u8ad6\u7406H\u307e\u305f\u306f\u8ad6\u7406L)\u304c\u53cd\u8ee2\u3057\u305f\u3068\u304d<\/span>\u306b\u751f\u3058\u308b\u3002\u3064\u307e\u308a\u3001\u30aa\u30d5\u3060\u3063\u305f\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30f3\u306b\u306a\u3063\u305f\u3068\u304d\u306b\u8d77\u3053\u308b\u304b\u3089\u3001\u30ea\u30e2\u30b3\u30f3\u306e\u30ad\u30fc\u64cd\u4f5c\u3067\u306f\u308f\u304b\u308a\u3084\u3059\u3044\u3002<\/p>\n<p>PCI\u3092\u5229\u7528\u3059\u308b\u969b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6e96\u5099\u3057\u3066\u304a\u304f\u3002<\/p>\n<ul>\n<li><em>GIMSK (General Interrupt Mask)<\/em>\u30ec\u30b8\u30b9\u30bf\u306ePCIE\u30d3\u30c3\u30c8\u30921\u3068\u3059\u308b\u3002<\/li>\n<li><em>PCMSK (Pin Change Mask)<\/em> \u30ec\u30b8\u30b9\u30bf\u5185\u306e\u3001PCI\u306e\u5bfe\u8c61\u3068\u3057\u305f\u3044\u30dd\u30fc\u30c8\u30d4\u30f3\u306e\u30d3\u30c3\u30c8(PCINT5\uff5ePCINT0)\u30921\u306b\u3059\u308b\u3002<\/li>\n<li>\u305d\u3057\u3066\u3001<em>SREG ( Status Register)<\/em> \u306eI\u30d3\u30c3\u30c8\u3092 sei() \u3057\u3066\u30bb\u30c3\u30c8\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>\u4eca\u56de\u306e\u30dc\u30fc\u30c9\u3067\u306fPB3\u306b\u30b9\u30a4\u30c3\u30c1\u3092\u63a5\u7d9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u305f\u3002PCI\u306f\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u306e\u5fa9\u5e30\u306b\u306e\u307f\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9\u306e\u4e2d\u8eab\u306f\u8981\u3089\u306a\u3044\u3002<\/p>\n<pre class=\"lang:c++ decode:true\">ISR (PCINT0_vect) { }\r\nint main() {\r\n  setup();\r\n  for(;;) {\r\n    GIMSK = 0x20; \/\/ set GIMASK PCIE bit.\r\n    PCMSK = 0x8;  \/\/ enable PCINT3 (PB3)\r\n    set_sleep_mode(SLEEP_MODE_PWR_DOWN);\r\n    sleep_enable();\r\n    sleep_cpu();\r\n    sleep_disable();\r\n    if ((PINB &amp; _BV(3)) == 0) \r\n      continue;              \r\n    ...\r\n<\/pre>\n<p>\u3053\u3046\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u30b9\u30ea\u30fc\u30d7\u306b\u5165\u308b\u3068\u304d\u306b\u30aa\u30d5\u3060\u3063\u305f\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30f3\u306b\u306a\u308b\u3068\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3057 <em>sleep_disable();<\/em> \u4ee5\u4e0b\u304c\u5b9f\u884c\u3055\u308c\u308b\u3002\u9006\u306b\u3001\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30f3\u306e\u307e\u307e\u30b9\u30ea\u30fc\u30d7\u306b\u5165\u3063\u305f\u3068\u304d\u306f\u30aa\u30d5\u306b\u306a\u3063\u305f\u6642\u70b9\u3067\u3082\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3057\u3066\u304f\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u30b9\u30ea\u30fc\u30d7\u5fa9\u5e30\u5f8c\u306b\u30dd\u30fc\u30c8\u30d4\u30f3PB3\u306e\u72b6\u614b\u3092\u8aad\u3093\u3067\u3001L\u30ec\u30d9\u30eb\u306a\u3089\u4f59\u8a08\u306a\u51e6\u7406\u3092\u884c\u308f\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9\u306e\u4e2d\u8eab\u304c\u8981\u3089\u306a\u3044\u304b\u3089\u3068\u3044\u3063\u3066\u3001<span class=\"lang:default decode:true crayon-inline \">ISR (PCINT0_vect) { }<\/span>\u00a0\u00a0\u3092\u7701\u7565\u3057\u3066\u3057\u307e\u3046\u3068PCI\u304c\u8d77\u304d\u308b\u305f\u3073\u306b\u30ea\u30bb\u30c3\u30c8(0\u756a\u5730\u304b\u3089\u5b9f\u884c)\u3055\u308c\u308b\u3053\u3068\u306b\u6ce8\u610f\u3002\u3053\u308c\u306fPCI\u7528\u306e\u5272\u8fbc\u307f\u30d9\u30af\u30bf\u306e\u4e2d\u8eab(\u98db\u3073\u5148)\u304c <strong><em>__bad_interrupt<\/em><\/strong>\u00a0\u306e\u307e\u307e\u306a\u305f\u3081\u306a\u306e\u3060\u304c\u3001\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\u3059\u308b\u3002<\/p>\n<h2>\u62b5\u6297\u5206\u5727\u3092\u4f7f\u3063\u3066\u3001\u62bc\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u3092\u8b58\u5225<\/h2>\n<p>\u4eca\u56de\u306e\u56de\u8def\u3067\u306f\u3001\u62bc\u4e0b\u4e2d\u306e\u30b9\u30a4\u30c3\u30c1\u306b\u5fdc\u3058\u3066\u62b5\u6297\u5024\u304c\u5909\u308f\u308b\u5206\u5727\u56de\u8def\u306b\u3088\u3063\u3066\u96fb\u6e90\u96fb\u5727\u3092\u5206\u5727\u3057\u3001\u5185\u8535A\/D\u30b3\u30f3\u30d0\u30fc\u30bf\u3067\u96fb\u5727\u3092\u8aad\u307f\u53d6\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u306a\u306e\u3067\u30014\u3064\u306e\u30bf\u30af\u30c8\u30b9\u30a4\u30c3\u30c1\u3092\u4e26\u3079\u305f\u69cb\u6210\u3068\u3057\u3066\u3044\u308b\u304c\u30b9\u30a4\u30c3\u30c1\u7528\u306e\u30dd\u30fc\u30c8\u30d4\u30f3\u306fPB3\u3060\u3051\u3067\u6e08\u3093\u3060\u3002<\/p>\n<p>\u30b9\u30a4\u30c3\u30c1\u90e8\u5206\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56de\u8def\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<figure id=\"attachment_7571\" aria-describedby=\"caption-attachment-7571\" style=\"width: 293px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/0d40a5e4a645fc6b96e767d64ac0878e.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7571\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/0d40a5e4a645fc6b96e767d64ac0878e.png\" alt=\"\" width=\"293\" height=\"276\" \/><\/a><figcaption id=\"caption-attachment-7571\" class=\"wp-caption-text\">\u30b9\u30a4\u30c3\u30c1\u306b\u3088\u308b\u5206\u5727\u56de\u8def<\/figcaption><\/figure>\n<p>\u62b5\u6297R0 = 51k\u03a9\u3068\u3057\u3001R1\uff5eR4\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u62b5\u6297\u5024\u3068\u3057\u305f\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>SW<\/td>\n<td>\u62b5\u6297<\/td>\n<td>\u5206\u5727\u7387<\/td>\n<td>\u5909\u63db\u5024<\/td>\n<\/tr>\n<tr>\n<td>SW1<\/td>\n<td>R1 = 0 (\u76f4\u7d50)<\/td>\n<td>100%<\/td>\n<td>1023<\/td>\n<\/tr>\n<tr>\n<td>SW2<\/td>\n<td>R2 = 4.7k<\/td>\n<td>92%<\/td>\n<td>940<\/td>\n<\/tr>\n<tr>\n<td>SW3<\/td>\n<td>R3 = 15k<\/td>\n<td>77%<\/td>\n<td>787<\/td>\n<\/tr>\n<tr>\n<td>SW4<\/td>\n<td>R4 = 22k<\/td>\n<td>70%<\/td>\n<td>716<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3044\u305a\u308c\u304b\u306e\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3068\u304d\u306bPB3\u306b\u304b\u304b\u308b\u96fb\u5727\u306f\u3001Vcc \u00d7 <em>R0 \/ (Rn + R0)<\/em>\u00a0\u306b\u306a\u308b\u3002ATtiny\u306eA\/D\u30b3\u30f3\u30d0\u30fc\u30bf\u306f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u96fb\u5727\u3068\u3057\u3066Vcc\u3092\u9078\u629e\u3067\u304d\u308b\u304b\u3089\u3001A\/D\u5909\u63db\u7d50\u679c\u304c\u30d5\u30eb\u30b9\u30b1\u30fc\u30eb(1023)\u306e\u4f55%\u306a\u306e\u304b\u3092\u8a08\u7b97\u3057\u3001\u30b9\u30a4\u30c3\u30c1\u3054\u3068\u306e\u5206\u5727\u7387\u3068\u6bd4\u8f03\u3059\u308c\u3070\u62bc\u4e0b\u3055\u308c\u305f\u30b9\u30a4\u30c3\u30c1\u3092\u8b58\u5225\u3067\u304d\u308b\u3002\u96fb\u6c60\u306e\u6d88\u8017\u306b\u3088\u3063\u3066\u96fb\u6e90\u96fb\u5727\u304c\u5909\u52d5\u3057\u305f\u3068\u3057\u3066\u3082\u5f71\u97ff\u3092\u53d7\u3051\u306a\u3044\u3002<\/p>\n<p>\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\u306f\u3001PB3\u306b\u304b\u304b\u308b\u6700\u5c0f\u96fb\u5727\u304cATtiny\u306e<span style=\"text-decoration: underline;\">\u6700\u5c0f\u5165\u529bH\u96fb\u5727(V<small>IH<\/small>\u00a0Min.) \u3092\u4e0b\u56de\u3089\u306a\u3044\u3053\u3068<\/span>\u3060\u308d\u3046\u3002\u4e0b\u56de\u3063\u3066\u3057\u307e\u3046\u3068\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u3057\u305f\u3068\u3057\u3066\u3082PB3\u306e\u72b6\u614b\u306f\u8ad6\u7406L\u306e\u307e\u307e\u306a\u306e\u3067PCI\u304c\u8d77\u304d\u306a\u3044\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>\u30b3\u30a4\u30f3\u96fb\u6c60\u3067\u306e\u99c6\u52d5\u6642\u306b\u306fVcc= 2.0V\u307e\u3067\u306e\u52d5\u4f5c\u3092\u671f\u5f85\u3057\u305f\u3044\u306e\u3067\u3001\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u306eDC\u7279\u6027\u306b\u57fa\u3065\u3044\u3066V<small>IH<\/small>\u00a0(Min) = 0.7 \u00d7 Vcc \u3068\u3057\u3066\u62b5\u6297\u5024\u3092\u6c7a\u3081\u305f\u3002Vcc (min) = 2.4V\u3068\u3059\u308b\u306a\u3089\u3070\u30010.6 \u00d7 Vcc\u307e\u3067\u306f\u8ad6\u7406H\u3068\u306a\u308b\u306e\u3067\u3001\u3082\u3046\u3061\u3087\u3063\u3068\u5927\u304d\u306a\u62b5\u6297\u3092\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3060\u308d\u3046\u3057\u30011\u3064\u306e\u30dd\u30fc\u30c8\u30d4\u30f3\u306b\u63a5\u7d9a\u3059\u308b\u30b9\u30a4\u30c3\u30c1\u6570\u3092\u5897\u3084\u3059\u3053\u3068\u3082\u3067\u304d\u308b\u3002<\/p>\n<p>\u4eca\u56dePB3\u3092\u30ad\u30fc\u5165\u529b\u306b\u4f7f\u3046\u3053\u3068\u306b\u3057\u305f\u306e\u306f\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=7369\" target=\"_blank\" rel=\"noopener\">Arduino PRO MINI\u3092\u4f7f\u3063\u305fISP\u30dc\u30fc\u30c9<\/a>\u306b\u8f09\u305b\u305f\u307e\u307e\u30b9\u30b1\u30c3\u30c1\u306e\u52d5\u4f5c\u78ba\u8a8d\u304c\u3057\u305f\u304b\u3063\u305f\u304b\u3089\u3002ISP\u30dc\u30fc\u30c9\u306b\u8f09\u305b\u3066\u3044\u308b\u3068\u304d\u306f\u3001SPI\u7528\u306e3\u672c( SCK = PB2\u3001MISO = PB1\u3001MOSI = PB0)\u304cPRO MINI\u306b\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u96fb\u6c17\u7684\u306a\u5f71\u97ff\u306a\u304f\u4f7f\u3048\u308b\u306e\u306fPB3\u3068PB4\u3060\u3051\u3060\u3063\u305f\u3002\u3082\u3046\u4e00\u672c\u306ePB4\u306fIRLED\u306e\u99c6\u52d5\u306b\u4f7f\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>ISP\u30dc\u30fc\u30c9\u306b\u8f09\u305b\u305f\u307e\u307e\u4f7f\u308f\u306a\u3044\u306a\u3089\u3070\u3001IRLED\u306e\u99c6\u52d5\u3092PB1\u3067\u884c\u3044\u3001PB2(ADC1)\u3001 PB3(ADC3)\u3001PB4(ADC2)\u306b\u305d\u308c\u305e\u308c4\u3064\u306e\u30b9\u30a4\u30c3\u30c1\u3092\u3064\u306a\u3052\u308c\u3070\u3001ATtiny\u5358\u72ec\u3067\u308212\u500b\u306e\u30b9\u30a4\u30c3\u30c1\u3092\u6301\u3064\u30ea\u30e2\u30b3\u30f3\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u308d\u3046\u3002<\/p>\n<h2>Arduino\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4e00\u5207\u30ea\u30f3\u30af\u3057\u306a\u3044<\/h2>\n<p>Arduino\u306f\u5352\u696d\u3068\u304b\u3067\u306f\u306a\u304f\u3066\u3001<em><strong>TC0 (\u30bf\u30a4\u30de\u30fc\u30ab\u30a6\u30f3\u30bf0)\u30e6\u30cb\u30c3\u30c8<\/strong><\/em>\u306e\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9(\u00a0<strong><em>ISR(TIMER0_OVF_vect) {}\u00a0<\/em><\/strong> )\u3092\u81ea\u524d\u3067\u6301\u3061\u305f\u304b\u3063\u305f\u306e\u3067\u3001\u5fc5\u7136\u7684\u306b\u305d\u3046\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u305f\u3002\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306f\u3042\u307e\u308a\u6d3b\u8e8d\u3057\u3066\u3044\u306a\u3044\u306e\u3060\u3051\u3069\u3001\u30ea\u30d4\u30fc\u30c8\u9001\u4fe1\u306a\u3069\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u610f\u8b58\u3057\u305f\u4f7f\u3044\u65b9\u3092\u3059\u308b\u306a\u3089\u3070\u3001\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u3068\u30bf\u30a4\u30de\u30fc\u306b\u3088\u308b\u5fa9\u5e30\u6a5f\u80fd\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002\u306a\u304a\u304b\u3064\u3001\u30b9\u30ea\u30fc\u30d7\u6642\u306b\u306fTC1\u3067\u306f\u306a\u304f\u3066TC0\u3092\u4f7f\u3044\u305f\u3044\u3002<br \/>\n\u305d\u306e\u305f\u3081\u306b\u306f\u3001Arduino\u306e\u30b3\u30a2\u306b\u3042\u308b <em>wiring.c<\/em>\u304c\u30ea\u30f3\u30af\u3055\u308c\u308b\u3068\u56f0\u308b\u306e\u3067\u3042\u308b\u3002\u305f\u3068\u3048\u3070\u3001\u30b9\u30b1\u30c3\u30c1\u306e\u4e2d\u304b\u3089<em>delayMicroseconds();<\/em> \u3092\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u3001\u30d3\u30eb\u30c9\u6642\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u3067\u308b(\u7a7a\u884c\u306f\u524a\u9664)\u3002<\/p>\n<pre class=\"lang:default decode:true\">wiring.c.o (symbol from plugin): In function `delayMicroseconds':\r\n(.text+0x0): multiple definition of `__vector_5'\r\nC:\\Users\\...\\Temp\\arduino_build_500229\\sketch\\test.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here\r\ncollect2.exe: error: ld returned 1 exit status\r\nexit status 1\r\n\u30dc\u30fc\u30c9ATtiny25\/45\/85\u306b\u5bfe\u3059\u308b\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002<\/pre>\n<p>\u3053\u308c\u306f\u3001TC0\u306e\u30bf\u30a4\u30de\u30fc\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9\u304c\u3001<em>delayMicroseconds()<\/em> \u306e\u3042\u308b <em>wiring.c.o<\/em> \u3067\u65e2\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u307e\u3059\u3088\u3001\u91cd\u8907\u306f\u30c0\u30e1\u3067\u3059\u3088\u3001\u3068\u3044\u3046\u3053\u3068\u3002\u3053\u306e\u30a8\u30e9\u30fc\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001wiring.c \u5185\u306b\u3042\u308b\u95a2\u6570\u306e\u5229\u7528\u306f\u3042\u304d\u3089\u3081\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<\/p>\n<p>\u3067\u3001\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u306e\u304b\u3068\u3044\u3046\u3068\u81ea\u524d\u306e\u30b9\u30b1\u30c3\u30c1\u5185\u306b\u30e1\u30a4\u30f3\u95a2\u6570\u3068\u3057\u3066\u3001<\/p>\n<pre class=\"nums:false lang:default decode:true\">int main() { ... }<\/pre>\n<p>\u3092\u66f8\u3051\u3070\u3088\u304b\u3063\u305f\u3002\u3053\u306e\u8a71\u306f\u3001<a href=\"https:\/\/www.avrfreaks.net\/\" target=\"_blank\" rel=\"noopener\">avrfreaks<\/a> \u306e\u53e4\u3044\u66f8\u8fbc\u307f\u306b\u3042\u3063\u305f\u3088\u3046\u306b\u601d\u3046\u3002<br \/>\nmain() {} \u304c\u30b9\u30b1\u30c3\u30c1\u5074\u306b\u3042\u308c\u3070\u3001arduino\u306ecore\u306b\u3042\u308bmain.cpp\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u7d50\u679c\u306f\u30ea\u30f3\u30af\u3055\u308c\u305a\u30b9\u30b1\u30c3\u30c1\u5074\u306emain() \u304c\u30e6\u30fc\u30b6\u30fc\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30a8\u30f3\u30c8\u30ea\u306b\u306a\u308b\u3002\u305d\u3057\u3066\u3001<em>init();<\/em>\u00a0\u3084<em>TIMER0_OVF_vect \u306e<\/em><em>ISR<\/em>\u00a0\u3092\u542b\u3080 wiring.c\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u3082\u30ea\u30f3\u30af\u3055\u308c\u306a\u304f\u306a\u308b\u3002<br \/>\n\u4ee3\u511f\u3068\u3057\u3066\u3001<em>delayMicroseconds();<\/em> \u306e\u3088\u3046\u306a\u6709\u7528\u306a\u95a2\u6570\u304c\u4f7f\u3048\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u3002\u3053\u306e\u95a2\u6570\u306f\u547d\u4ee4\u306e\u5b9f\u884c\u30af\u30ed\u30c3\u30af\u6570\u306b\u57fa\u3065\u3044\u3066\u30eb\u30fc\u30d7\u3092\u56de\u3059\u3060\u3051\u306a\u306e\u3060\u304c\u3001\u30b3\u30d4\u30fc\u3057\u3066\u304f\u308b\u306e\u3067\u306f\u9762\u767d\u307f\u304c\u306a\u3044\u3002<\/p>\n<h5>avr-objdump<\/h5>\n<p>\u672c\u5f53\u306b\u610f\u56f3\u3057\u3066\u3044\u306a\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u3069\u3046\u304b\u306e\u78ba\u8a8d\u3084\u3001\u30ed\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u5168\u4f53\u306e\u69cb\u6210\u3092\u77e5\u308b\u306b\u306f\u00a0<strong><em>avr-objdump<\/em><\/strong> \u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u4f7f\u3046\u3002\u3053\u306e\u30c4\u30fc\u30eb\u3082<strong><em>avr-nm<\/em><\/strong>\u306a\u3069\u3068\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b(\u30ea\u30f3\u30af\u6e08\u307f\u306e\u30b7\u30f3\u30dc\u30eb\u3092\u898b\u308b\u3060\u3051\u306a\u3089avr-nm\u3067\u3082\u3044\u3044\u306e\u3060\u304c)\u3002avr-objdump \u306e<a href=\"http:\/\/ccrma.stanford.edu\/planetccrma\/man\/man1\/avr-objdump.1.html\" target=\"_blank\" rel=\"noopener\">man \u306f\u3053\u3061\u3089<\/a>\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001test.ino \u3068\u3044\u3046\u30b9\u30b1\u30c3\u30c1\u3092Arduino-IDE\u3067\u30d3\u30eb\u30c9\u3057\u3001test.ino.elf \u3068\u3044\u3046\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u304c\u4e00\u6642\u30d5\u30a9\u30eb\u30c0\u306b\u4f5c\u6210\u3055\u308c\u305f\u3068\u3059\u308b\u3068\u3001<br \/>\n<em><strong>\u3000\u3000avr-objdump -S test.ino.elf<\/strong><\/em><br \/>\n\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u4f5c\u6210\u3055\u308c\u305f\u30ed\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u5168\u4f53\u306e\u30a2\u30bb\u30f3\u30d6\u30e9\u30ea\u30b9\u30c6\u30a3\u30f3\u30b0(\u30b9\u30b1\u30c3\u30c1\u4ed8\u304d)\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u304c\u51fa\u529b\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\bin&gt;avr-objdump -S test.ino.elf\r\ntest.ino.elf:     file format elf32-avr\r\n\r\nDisassembly of section .text:\r\n\r\n00000000 &lt;__vectors&gt;:\r\n   0:   0e c0           rjmp    .+28            ; 0x1e &lt;__ctors_end&gt;\r\n   2:   1d c0           rjmp    .+58            ; 0x3e &lt;__bad_interrupt&gt;\r\n   4:   9e c0           rjmp    .+316           ; 0x142 &lt;__vector_2&gt;\r\n   6:   1b c0           rjmp    .+54            ; 0x3e &lt;__bad_interrupt&gt;\r\n   8:   1a c0           rjmp    .+52            ; 0x3e &lt;__bad_interrupt&gt;\r\n   a:   a5 c0           rjmp    .+330           ; 0x156 &lt;__vector_5&gt;\r\n   ...\r\n0000001e &lt;__ctors_end&gt;:\r\n  1e:   11 24           eor     r1, r1\r\n  20:   1f be           out     0x3f, r1        ; 63\r\n  22:   cf e5           ldi     r28, 0x5F       ; 95\r\n  24:   d1 e0           ldi     r29, 0x01       ; 1\r\n  ...\r\n0000002a &lt;__do_clear_bss&gt;:\r\n  ...\r\n00000032 &lt;.do_clear_bss_loop&gt;:\r\n  ...\r\n00000034 &lt;.do_clear_bss_start&gt;:\r\n  34:   a4 36           cpi     r26, 0x64       ; 100\r\n  36:   b2 07           cpc     r27, r18\r\n  38:   e1 f7           brne    .-8             ; 0x32 &lt;.do_clear_bss_loop&gt;\r\n  3a:   a7 d0           rcall   .+334           ; 0x18a &lt;main&gt;\r\n  3c:   5c c2           rjmp    .+1208          ; 0x4f6 &lt;_exit&gt;\r\n\r\n0000003e &lt;__bad_interrupt&gt;:\r\n  3e:   e0 cf           rjmp    .-64            ; 0x0 &lt;__vectors&gt;\r\n\r\n00000040 &lt;_Z8user_func.part.0&gt;:\r\nvoid user_func() {\r\n....\r\n000004f6 &lt;_exit&gt;:\r\n 4f6:   f8 94           cli\r\n000004f8 &lt;__stop_program&gt;:\r\n 4f8:   ff cf           rjmp    .-2             ; 0x4f8 &lt;__stop_program&gt;\r\n\r\nC:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\bin&gt;<\/pre>\n<p>\u9577\u304f\u306a\u308b\u306e\u3067\u4e00\u90e8\u7701\u7565\u3057\u305f\u304c\u30010\u756a\u5730\u304b\u3089\u30d9\u30af\u30bf\u30c6\u30fc\u30d6\u30eb\u304c\u59cb\u307e\u308a\u300128\u884c\u76ee\u3067 main() \u3092\u547c\u51fa\u3057\u3066\u3044\u308b\u306e\u304c\u5206\u304b\u308b\u3002\u305d\u306e\u5f8c\u3092\u898b\u3066\u3044\u3063\u3066\u3082\u3001\u610f\u56f3\u3057\u3066\u3044\u306a\u3044\u95a2\u6570\u306f\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3060\u3063\u305f\u3002\u81ea\u5206\u306e\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u304c\u3069\u3046\u3044\u3046\u547d\u4ee4\u306b\u7ffb\u8a33\u3055\u308c\u305f\u306e\u304b\u3092\u898b\u305f\u308a\u3001\u5b9f\u884c\u6642\u306b\u30b9\u30bf\u30c3\u30af\u304c\u3069\u308c\u3060\u3051\u7a4d\u307f\u4e0a\u304c\u308b\u306e\u304b\u3092\u77e5\u308b\u305f\u3081\u306b\u3082\u6709\u76ca\u3060\u308d\u3046\u3002<\/p>\n<p>\u4e0a\u306e\u5185\u5bb9\u306e\u6700\u521d\u306e\u65b9\u306e <em><strong>&lt;<\/strong><strong>__vectors&gt;<\/strong><\/em> \u3092\u898b\u308b\u3068\u3001\u5272\u8fbc\u307f\u30d9\u30af\u30bf2(<em>PCINT0<\/em>)\u3068\u30d9\u30af\u30bf5(<em>TIMER0_OVF<\/em>)\u304c\u30b9\u30b1\u30c3\u30c1\u3067\u5b9a\u7fa9\u6e08\u3067\u3001\u305d\u306e\u4ed6\u306e\u30d9\u30af\u30bf\u306f<em><strong>__bad_interrupt<\/strong> <\/em>\u3092\u5411\u3044\u3066\u3044\u308b\u3002\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9\u304c\u30b9\u30b1\u30c3\u30c1\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5b9a\u7fa9\u6e08\u307f\u306e\u5272\u8fbc\u307f\u304c\u8d77\u304d\u305f\u3068\u304d\u306f\u5bfe\u5fdc\u3059\u308b\u95a2\u6570\u306b\u98db\u3076\u304c\u3001\u672a\u5b9a\u7fa9\u306e\u5272\u8fbc\u307f\u304c\u8d77\u304d\u305f\u3068\u304d\u306b\u306f31\u884c\u76ee\u306e\u00a0<em>__bad_interrupt<\/em>\u306b\u98db\u3070\u3055\u308c\u30ea\u30b9\u30bf\u30fc\u30c8(0\u756a\u5730\u306b\u30b8\u30e3\u30f3\u30d7)\u3059\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u3002\u30b9\u30b1\u30c3\u30c1\u5185\u3067\u3001<span class=\"lang:default decode:true crayon-inline\">ISR (PCINT0_vect) {}\u00a0<\/span>\u00a0\u3092\u5ba3\u8a00\u3059\u308b\u3053\u3068\u3067\u3001\u6240\u5b9a\u306e\u30d9\u30af\u30bf\u306e\u5185\u5bb9\u304c\u30cf\u30f3\u30c9\u30e9\u306e\u30a2\u30c9\u30ec\u30b9\u306b\u66f8\u304d\u63db\u308f\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<h2>\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u3068\u6d88\u8cbb\u96fb\u6d41<\/h2>\n<p>\u306a\u305cTC1\u30e6\u30cb\u30c3\u30c8\u3067\u306f\u3060\u3081\u3067\u3001TC0\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\u306e\u304b\u306b\u3064\u3044\u3066\u3002<\/p>\n<p>\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u6a5f\u80fd\u306f\u3001\u3042\u307e\u308a\u5185\u90e8\u30af\u30ed\u30c3\u30af\u3092\u3068\u3081\u306a\u3044\u30b9\u30ea\u30fc\u30d7\u30e2\u30fc\u30c9\u3067\u3001\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u306b\u6bd4\u3079\u308b\u3068\u5927\u5e45\u306b\u96fb\u6d41\u3092\u6d88\u8cbb\u3059\u308b\u3002ATtiny\u306e<em>PRR(Power Reduction Register )<\/em>\u3092\u64cd\u4f5c\u3057\u3066\u5404\u90e8\u306e\u52d5\u4f5c\u3092\u7981\u6b62\u3057\u306a\u304c\u3089\u5b9f\u969b\u306b\u96fb\u6d41\u3092\u6e2c\u3063\u3066\u307f\u305f(\u5185\u90e81MHz, @3.0V)\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>PRR\u8a2d\u5b9a<\/th>\n<th>\u96fb\u6d41<\/th>\n<th>\u5099\u8003<\/th>\n<\/tr>\n<tr>\n<td>\u30a2\u30af\u30c6\u30a3\u30d6\u6642<\/td>\n<td>590\u03bcA<\/td>\n<td>\u30b9\u30ea\u30fc\u30d7\u305b\u305a\u306b\u7121\u9650\u30eb\u30fc\u30d7\u5b9f\u884c<br \/>\n(PRR = 3, ADC, USI\u505c\u6b62)<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" colspan=\"3\">(\u4ee5\u4e0b\u306f\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u4e2d)<\/td>\n<\/tr>\n<tr>\n<td>PRR = 0<\/td>\n<td>325\u03bcA<\/td>\n<td>PRR\u64cd\u4f5c\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td>PRR = 3<\/td>\n<td>298\u03bcA<\/td>\n<td>ADC\u3068USI\u3092\u505c\u6b62<\/td>\n<\/tr>\n<tr>\n<td>PRR = 7<\/td>\n<td>290\u03bcA<\/td>\n<td>ADC, USI, TC0\u505c\u6b62<\/td>\n<\/tr>\n<tr>\n<td>PRR = 11<\/td>\n<td>220\u03bcA<\/td>\n<td>ADC, USI, TC1\u505c\u6b62<\/td>\n<\/tr>\n<tr>\n<td>PRR = 15<\/td>\n<td>213\u03bcA<\/td>\n<td>ADC, USI, TC0, TC1\u505c\u6b62<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>TC1\u306fTC0\u3088\u308a\u3082\u5927\u5e45\u306b\u96fb\u6d41\u3092\u4f7f\u3046\u304b\u3089\u3001\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u306e\u5fa9\u5e30\u7528\u9014\u306b\u306f\u4f7f\u308f\u305a\u3001PRR\u3092\u4f7f\u3063\u3066TC1\u3092\u505c\u6b62\u3057\u3066\u304a\u304d\u305f\u3044\u3002\u4eca\u56de\u306f\u3001TC1\u306f\u8d64\u5916\u7dda\u9001\u51fa\u306e\u305f\u3081\u306epwm\u51fa\u529b\u6642\u306b\u306e\u307f\u6709\u52b9\u306b\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<h5>\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u3092\u4f7f\u3063\u305f\u9045\u5ef6\u95a2\u6570 delay_us(), delay_ms()<\/h5>\n<p><em>\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u306e\u52c9\u5f37\u3082\u517c\u306d\u3066\u3001delayMicroseconds(); <\/em>\u3084 <em>delay();<\/em>\u00a0\u306e\u4ee3\u308f\u308a\u306b\u306a\u308b\u00a0<em>void delay_us(uint16_t us); \u3068 void delay_ms(uint16_T ms);\u00a0<\/em>\u00a0\u3068\u3044\u3046\u95a2\u6570\u3092\u3084\u3063\u3064\u3051\u3067\u4f5c\u3063\u305f\u3002\u3044\u305a\u308c\u3082TC0\u306e\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5272\u8fbc\u307f\u3068\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u3092\u5229\u7528\u3059\u308b\u3002<br \/>\n\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5272\u8fbc\u307f\u306fTC0\u306e\u30ab\u30a6\u30f3\u30bf<em>TCNT0<\/em>\u304c255\u306e\u3068\u304d\u6b21\u306e\u30af\u30ed\u30c3\u30af\u3067\u8d77\u304d\u308b\u304b\u3089\u3001\u30d7\u30ea\u30b9\u30b1\u30fc\u30e9\u3067\u30ab\u30a6\u30f3\u30bf\u306e\u5206\u89e3\u80fd\u3092\u6307\u5b9a\u3057\u3001\u30ab\u30a6\u30f3\u30bf\u306e\u521d\u671f\u5024\u3092\u6307\u5b9a\u3057\u3066\u3084\u308b\u3053\u3068\u3067\u90fd\u5408\u306e\u3088\u3044\u6642\u70b9\u3067\u5272\u8fbc\u307f\u3092\u8d77\u3053\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>delay_us()\u306e\u65b9\u306f\u3001TC0\u30921\/8 \u30d7\u30ea\u30b9\u30b1\u30fc\u30e9 \u3067\u52d5\u304b\u3059\u306e\u3067\u30ab\u30a6\u30f3\u30bfTCNT0\u306f8\u03bcsec\u305a\u3064\u5897\u3048\u3066\u3044\u304f\u30022048\u03bcsec\u4ee5\u4e0a\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7\u306b\u5165\u308b\u3002\u30bf\u30a4\u30de\u30fc\u5272\u8fbc\u307f\u3092\u4f7f\u3046\u305f\u3081\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3082\u3042\u3063\u3066\u3001\u5f15\u6570\u306b50\u03bcsec\u4ee5\u4e0a\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306b\u306e\u307f\u6709\u52b9\u3002\u305d\u308c\u4ee5\u4e0b\u306e\u5834\u5408\u3001\u3059\u3050\u306b(4\u03bcsec\u7a0b\u5ea6)\u3067\u30ea\u30bf\u30fc\u30f3\u3059\u308b\u3002\u3088\u308a\u77ed\u304f\u6b63\u78ba\u306a\u9045\u5ef6\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u81ea\u524d\u306e\u5272\u8fbc\u307f\u30cf\u30f3\u30c9\u30e9\u3092\u3042\u304d\u3089\u3081\u3066delayMicroseconds(); \u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>delay_ms() \u306e\u65b9\u306f\u30011\/64\u306e\u30d7\u30ea\u30b9\u30b1\u30fc\u30e9\u3092\u8a2d\u5b9a\u3057\u3001\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5272\u8fbc\u307f\u306f10msec\u5358\u4f4d\u306b\u8d77\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u3053\u3061\u3089\u306f1msec\uff5e65535 msec\u307e\u3067\u6307\u5b9a\u53ef\u80fd\u3002<\/p>\n<p>\u7bc0\u96fb\u52b9\u679c\u304b\u3089\u307f\u308b\u3068\u3001\u4f8b\u3048\u3070 <em>delay_us(10000);<\/em> \u3068\u3057\u305f\u5834\u5408\u3001\u7d048.2msec\u306e\u9593\u306f\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7(220uA)\u3057\u3001\u7d041.8msec\u306e\u9593\u306f\u30a2\u30af\u30c6\u30a3\u30d6\u52d5\u4f5c(590uA)\u3059\u308b\u300210msec\u9593\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u52d5\u4f5c\u306b\u6bd4\u3079\u308b\u3068\u3001(220 \u00d7 8.2 + 590 \u00d7 1.8) \/ (590 \u00d7 10) = 0.48\u306a\u306e\u306750%\u5f37\u306e\u7bc0\u7d04\u3002<\/p>\n<p>delay_ms(100)\u3068\u3057\u305f\u5834\u5408\u3001\u307b\u3068\u3093\u3069\u30b9\u30ea\u30fc\u30d7\u3067\u904e\u3054\u305710\u56de\u76ee\u306e\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5272\u308a\u8fbc\u307f\u304c\u8d77\u304d\u308b\u3068\u30ea\u30bf\u30fc\u30f3\u3059\u308b\u304b\u3089\u3001590\u03bcA \u00d7 100msec\u306b\u5bfe\u3057\u3066220\u03bcA \u00d7 100msec\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u3001\u7d0463%\u7a0b\u5ea6\u306e\u7bc0\u96fb\u306b\u306a\u308b\u3002<\/p>\n<p>TC1\u3084ADC\u3092\u4f7f\u3046\u3053\u3068\u304c\u5206\u304b\u3063\u3066\u3044\u308b\u5834\u5408\u3001PRR\u306e\u64cd\u4f5c\u306b\u306f\u6c17\u3092\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306f\u3001setup() \u306b\u304a\u3044\u3066USI\u3001ADC\u3001TC1\u3092\u505c\u6b62\u3057\u3001ADC\u3092\u4f7f\u3046\u3068\u304d\u306e\u307fADC\u3092\u6709\u52b9\u5316\u3001\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u3068\u304d\u306e\u307fC1\u3092\u6709\u52b9\u5316\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<h1>\u56de\u8def\u56f3<\/h1>\n<p>Arduino PRO MINI\u3092\u4f7f\u3063\u305fISP\u30dc\u30fc\u30c9\u4e0a\u306b\u8f09\u305b\u305f\u307e\u307e\u3067\u3082\u52d5\u304f\u3088\u3046\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56de\u8def\u306b\u3057\u305f\u3002<\/p>\n<figure id=\"attachment_7576\" aria-describedby=\"caption-attachment-7576\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/ATINY_IR_KEY1ISP.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7576\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/ATINY_IR_KEY1ISP-552x345.png\" alt=\"\" width=\"552\" height=\"345\" \/><\/a><figcaption id=\"caption-attachment-7576\" class=\"wp-caption-text\">ATINY_IR_KEY1(ISP)<\/figcaption><\/figure>\n<p>\u3080\u308d\u3093\u3001ISP\u30dc\u30fc\u30c9\u304b\u3089\u5916\u3057\u3066\u5c02\u7528\u306e\u96fb\u6e90\u306b\u3057\u3066\u3082\u540c\u3058\u3088\u3046\u306b\u52d5\u304f\u3002<\/p>\n<p>\u6ce8\u610f\u3057\u305f\u70b9\u306f\u3001ISP\u30dc\u30fc\u30c9\u306b\u8f09\u305b\u3066\u3044\u308b\u3068\u304d\u306e\u96fb\u6e90\u306fPC\u306eUSB\u304b\u3089\u6765\u308b+5V\u5f31\u306a\u306e\u306b\u5bfe\u3057\u3001\u60f3\u5b9a\u3057\u3066\u3044\u308b\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306f\u30b3\u30a4\u30f3\u96fb\u6c60\u3067\u99c6\u52d5\u3059\u308b\u304b\u3089\u96fb\u6e90\u96fb\u5727\u306f+3.3\uff5e+2.0V\u306b\u306a\u308b\u3053\u3068\u3002\u305d\u306e\u305f\u3081\u3001IRLED\u5468\u8fba\u306e\u62b5\u6297(R5, R6)\u306f\u3001+5.0V\u6642\u306bIF\u304c100mA\u3092\u8d85\u3048\u306a\u3044\u3088\u3046\u5927\u304d\u3081\u306b\u3057\u3001\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u306e\u30d9\u30fc\u30b9\u306b\u6d41\u3059\u96fb\u6d41\u3082\u63a7\u3048\u3081(2mA\u7a0b\u5ea6)\u306b\u3057\u305f\u3002\u30b3\u30a4\u30f3\u96fb\u6c60\u306e\u307f\u3067\u99c6\u52d5\u3059\u308b\u306a\u3089\u3070\u3001R5\u3001R6\u5171\u306b\u3088\u308a\u5c0f\u3055\u306a\u62b5\u6297\u5024\u306b\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306e\u30dc\u30fc\u30c9\u3067\u96fb\u6e90\u96fb\u5727\u3092\u5909\u3048\u306a\u304c\u3089\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001+2.0V\u307e\u3067\u306f\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u3092\u6b63\u3057\u304f\u51fa\u529b\u3057\u3066\u3044\u305f(\u53d7\u4fe1\u5074\u3067\u30c7\u30fc\u30bf\u3092\u628a\u63e1\u3067\u304d\u305f)\u304c\u3001\u305d\u308c\u3092\u4e0b\u56de\u308b\u3068\u602a\u3057\u304f\u306a\u3063\u305f\u3002\u9001\u4fe1\u5074\u3068\u53d7\u4fe1\u5074\u306e\u8ddd\u96e2\u304c50cm\u7a0b\u5ea6\u306a\u3053\u3068\u3092\u8003\u3048\u308b\u3068\u3001\u4eca\u56de\u306e\u62b5\u6297\u5024\u306f\u30b3\u30a4\u30f3\u96fb\u6c60\u3067\u99c6\u52d5\u3059\u308b\u30ea\u30e2\u30b3\u30f3\u3068\u3057\u3066\u306f\u5b9f\u7528\u7684\u3067\u306f\u306a\u3055\u305d\u3046\u3067\u3042\u308b(\u4f4e\u96fb\u5727\u7248\u306eATtiny45V\u3092\u4f7f\u7528)\u3002<\/p>\n<figure id=\"attachment_7588\" aria-describedby=\"caption-attachment-7588\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/55a8ff8e9da9546a9242501940a3e33f.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7588\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/55a8ff8e9da9546a9242501940a3e33f-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-7588\" class=\"wp-caption-text\">ATINY_IR_KEY1(ISP)<\/figcaption><\/figure>\n<p>\u5de6\u5074\u304cArduino PROMINI\u306eISP\u30dc\u30fc\u30c9\u3067\u66f8\u8fbc\u307f\u5148\u3068\u3057\u3066ATtiny45V\u3092\u8f09\u305b\u3066\u3044\u308b\u3002\u53f3\u5074\u304c\u30b9\u30a4\u30c3\u30c1\u3001\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u304a\u3088\u3073IRLED\u3092\u8f09\u305b\u305f\u30bf\u30fc\u30b2\u30c3\u30c8\u30dc\u30fc\u30c9\u3002ATtiny\u306ePB3\u3068PB4\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u30dc\u30fc\u30c9\u5074\u306b\u30b8\u30e3\u30f3\u30d1\u30ef\u30a4\u30e4\u3067\u63a5\u7d9a\u3057\u3066\u3044\u308b\u3002\u30bf\u30fc\u30b2\u30c3\u30c8\u30dc\u30fc\u30c9\u5074\u3067\u30b8\u30e3\u30f3\u30d1\u30ef\u30a4\u30e4\u304c\u3055\u3055\u3063\u3066\u3044\u308b\u3042\u305f\u308a\u306bATtiny\u3092\u633f\u3059\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<figure id=\"attachment_7589\" aria-describedby=\"caption-attachment-7589\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/9d0b2b88dcb7a3ecfdbc4f4d1381ecab.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7589\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/9d0b2b88dcb7a3ecfdbc4f4d1381ecab-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-7589\" class=\"wp-caption-text\">ATINY_IR_KEY1(ISP)<\/figcaption><\/figure>\n<p>\u5199\u771f\u3067\u306f\u96fb\u6e90\u3092\u63a5\u7d9a\u3057\u3066\u3044\u306a\u3044\u304c\u3001\u30bf\u30fc\u30b2\u30c3\u30c8\u30dc\u30fc\u30c9\u5074\u306bATtiny\u3092\u8f09\u305b\u308b\u3068\u5358\u72ec\u3067\u52d5\u4f5c\u3059\u308b\u3002<\/p>\n<figure id=\"attachment_7590\" aria-describedby=\"caption-attachment-7590\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/5658d064d9ac28ab4f3c79676f0bcede.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7590\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/5658d064d9ac28ab4f3c79676f0bcede-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-7590\" class=\"wp-caption-text\">IRLED L-53F3<\/figcaption><\/figure>\n<p>\u6c17\u307e\u3050\u308c\u306a\u306e\u3060\u3051\u3069\u3001\u4eca\u56de\u306fIRLED\u3068\u3057\u3066L-53F3BT\u3092\u4f7f\u3063\u305f\u3002\u30ec\u30f3\u30ba\u304c\u9752\u3044\u306e\u304c\u7279\u5fb4\u3067\u3001\u4eca\u307e\u3067\u306e\u5de5\u4f5c\u3067\u4f7f\u3063\u305fOSI5LA5113A\u3088\u308a\u3082\u7167\u5c04\u89d2\u304c\u5e83\u3044(<a href=\"https:\/\/datasheetspdf.com\/pdf-down\/L\/-\/5\/L-53F3C_ETC.pdf\" target=\"_blank\" rel=\"noopener\">\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u306f\u3053\u3061\u3089<\/a>)\u3002<br \/>\n\u3053\u306eIRLED\u306eI<small>F<\/small>\u306e\u7d76\u5bfe\u6700\u5927\u5b9a\u683c\u306f\u9023\u7d9a\u6642\u306750mA\u3001\u30d1\u30eb\u30b9\u6642(\u30c7\u30e5\u30fc\u30c6\u30a31\/100, H\u671f\u959310\u03bcsec) \u30671200mA\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u4eca\u56de\u306eIRLED\u5468\u308a\u306e\u62b5\u6297\u5024\u306f+3.3V\u52d5\u4f5c\u306e\u3064\u3082\u308a\u3067\u6c7a\u3081\u305f\u306e\u3067\u3001+5V\u6642\u306f6\uff5e7\u03bcsec\u7a0b\u5ea6\u306e\u30d1\u30eb\u30b9\u3060\u304cI<small>F<\/small>=70mA\u7a0b\u5ea6\u306e\u306f\u305a\u3002+5V\u307e\u3067\u52d5\u4f5c\u7bc4\u56f2\u306b\u8003\u3048\u308b\u306a\u3089\u3070\u3001\u4e0a\u306e\u56de\u8def\u306eR5\u306f68\u03a9\u3068\u3059\u3079\u304d\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<figure id=\"attachment_7591\" aria-describedby=\"caption-attachment-7591\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/a0eaf59b706d12a1a54582b7331c6438.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7591\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/a0eaf59b706d12a1a54582b7331c6438-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-7591\" class=\"wp-caption-text\">IRLED L-53F3<\/figcaption><\/figure>\n<p>\u3053\u306eIRLED\u3082\u3001\u6771\u829d\u306e2SC1815\u3082\u30c7\u30a3\u30b9\u30b3\u30f3\u306a\u306e\u3067\u3001\u3069\u3053\u304b\u3067\u5728\u5eab\u3092\u898b\u3064\u3051\u305f\u3089\u307e\u3068\u3081\u8cb7\u3044\u3057\u3066\u304a\u304d\u305f\u3044\u3068\u3053\u308d\u3002<\/p>\n<h1>\u30b9\u30b1\u30c3\u30c1<\/h1>\n<p>\u30b9\u30b1\u30c3\u30c1\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre class=\"lang:c++ decode:true\">#include &lt;avr\/wdt.h&gt;\r\n#include &lt;avr\/sleep.h&gt;\r\n\/*\r\n \u30a2\u30ca\u30ed\u30b0\u5024\u306b\u3088\u308b\u30b9\u30a4\u30c3\u30c1\u306e\u8b58\u5225\u3002\r\n \u8aad\u307f\u53d6\u3063\u305f\u96fb\u5727\u304cVCC\u306e\u4f55%\u306e\u96fb\u5727\u304b\u306b\u3088\u3063\u3066\u3001\u62bc\u4e0b\u3055\u308c\u3066\u3044\u308b\u30b9\u30a4\u30c3\u30c1\u3092\u8b58\u5225\u3059\u308b\u3002\r\n \u30b9\u30a4\u30c3\u30c1\u306e\u756a\u53f7\u3068\u305d\u306e\u3068\u304d\u306eA\/D\u5909\u63db\u7d50\u679c\u3092NEC\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u8d64\u5916\u7dda\u9001\u4fe1\u3059\u308b\u3002\r\n*\/\r\n\r\nstatic int tcnt0_initial = 0;\r\nISR(TIMER0_OVF_vect) {\r\n  TCNT0 = tcnt0_initial;\r\n}\r\nvoid do_delay(bool us, uint16_t period) {\r\n  uint16_t sleep_count;\r\n  uint16_t left = 0;\r\n  if (us) {\r\n    sleep_count = period &gt;&gt; 11;\r\n    left = (period - (sleep_count &lt;&lt; 11)) &gt;&gt; 3;\r\n    if (left &gt; 1)\r\n      left -= 2;  \r\n    TCCR0B = B00000010; \/\/ CS = 1\/8. 1clk = 8usec. overflow per 2048usec\r\n    TCNT0 = 0;\r\n    tcnt0_initial = 6;  \/\/ \u30b9\u30ea\u30fc\u30d7\u95a2\u4fc2\u3068\u30eb\u30fc\u30d7\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3068\u3057\u3066\u3002\r\n  } else {\r\n    sleep_count = period \/ 10;\r\n    left = (period % 10) * 16;\r\n    if (left &gt; 4)\r\n      left -= 5;\r\n    TCCR0B = B00000011; \/\/ CS = 1\/64. 1clk = 64usec. overflow per 16.384msec.\r\n    TCNT0 = tcnt0_initial = 101;  \/\/ MAX count = 155.\r\n  }\r\n  if (sleep_count) {\r\n    TIMSK = 2;\r\n    sei();\r\n    while(sleep_count &gt; 0) {\r\n      set_sleep_mode(SLEEP_MODE_IDLE);\r\n      sleep_enable();\r\n      sleep_cpu();\r\n      sleep_disable(); \r\n      sleep_count--;\r\n    }\r\n    TIMSK = 0;\r\n  }\r\n  if (left &gt; 0) {\r\n    TCNT0 = 0;\r\n    while((int)TCNT0 &lt; left)\r\n      ;\r\n  } \r\n}\r\nvoid delay_us(uint16_t us) {\r\n  if (us &lt; 50)\r\n    return;\r\n  do_delay(true, us);\r\n}\r\nvoid delay_ms(uint16_t ms) {\r\n  do_delay(false, ms);\r\n}\r\n\r\n\/\/ pwm\u51fa\u529b(PB4)\r\nconst uint16_t T_VALUE = 560;\r\nconst uint16_t T_LEADER = T_VALUE * 16;\r\nvoid pwm_out(bool leader = false) {\r\n\/\/ TC1 PB4 (OC1B)\r\n  OCR1C = 25;  \/\/ TOP value :  38kHz --&gt; 26.3us.\r\n  OCR1B = 6;  \/\/  H period  : 6.4us.\r\n  TCNT1 = 254;\r\n  TCCR1 = B10000001; \/\/ CTC=1. clear TCNT1 on OCR1C==TCNT1.\r\n  GTCCR = B01100000; \/\/ OC1B cleared on compare match. Set when TCNT1 = $00.\r\n  delay_us(leader ? T_LEADER : T_VALUE );\r\n  TCCR1 = 0;\r\n  GTCCR = 0;\r\n  PORTB = 0;\r\n}\r\ninline void send_bit(uint8_t value) {\r\n  pwm_out();\r\n  delay_us(value ? T_VALUE * 3: T_VALUE);\r\n}\r\nvoid send_byte(uint8_t value) {\r\n  send_bit(value &amp; 1);\r\n  send_bit(value &amp; 2);\r\n  send_bit(value &amp; 4);\r\n  send_bit(value &amp; 8);\r\n  send_bit(value &amp; 16);\r\n  send_bit(value &amp; 32);\r\n  send_bit(value &amp; 64);\r\n  send_bit(value &amp; 128);\r\n}\r\nvoid send_leader() {\r\n  pwm_out(true);\r\n  delay_us(T_VALUE * 8);   \r\n}\r\nvoid send_trailer() {\r\n  pwm_out();\r\n  delay_ms(10);\r\n}\r\nvoid send_frame(uint8_t* p, int8_t bytes) {\r\n  uint8_t save_prr = PRR;\r\n  PRR &amp;= 0xf7; \/\/ enable TC1\r\n  send_leader();\r\n  for(int i = 0; i &lt; bytes; i++)\r\n    send_byte(p[i]);\r\n  send_trailer();\r\n  PRR = save_prr; \/\/ restore PRR.\r\n}\r\n\/**\r\n * ADC\u30af\u30ed\u30c3\u30af\u306f \u30b7\u30b9\u30c6\u30e0\u30af\u30ed\u30c3\u30af\u00d71\/8 = 125kHz. (\u30d7\u30ea\u30b9\u30b1\u30fc\u30e9 3)\r\n * 3\u56de\u8aad\u3093\u3060\u5e73\u5747\u5024\u304b\u3089\u5206\u5727\u7387\u3092\u6c42\u3081\u308b\u3002\r\n *\/\r\nconst int8_t adc_repeat_count = 3;\r\nint8_t read_key(uint8_t&amp; ad_result) {\r\n  uint8_t save_prr = PRR;\r\n  PRR = save_prr &amp; 0xfe;  \/\/ enable adc clock.\r\n  ad_result = 0;\r\n  ADMUX = 3;          \/\/ 00000011  VCC used as Voltage refernce, select ADC3(PB3)\r\n  delay_us(1000);\r\n  ADCSRA = 0x83;      \/\/ 10000011  enable ADC, prescaler = 3 (1\/8)    \r\n  delay_us(1000);\r\n  long val = 0;\r\n  for(int i = 0 ; i &lt; adc_repeat_count; i++) {\r\n    ADCSRA |= 0x40;\r\n    while(ADCSRA &amp; 0x40)\r\n      ;\r\n    int result = ADCW;\r\n    if (result &lt; 512)\r\n      break;\r\n    val += result;\r\n    delay_us(100);\r\n  }\r\n  ADCSRA = 0; \/\/ disable.\r\n  PRR = save_prr;  \/\/ restore prr\r\n  if (val &lt; 1500)\r\n    return 0;\r\n  val = val * 100 \/ (1023 * adc_repeat_count);\r\n  ad_result = val;\r\n  if (val &gt;= 95)  \/\/ 100%\r\n    return 1;\r\n  else if (val &lt; 95 &amp;&amp; val &gt;= 84) \/\/ 91.6%\r\n    return 2;\r\n  else if (val &lt; 84 &amp;&amp; val &gt;= 75) \/\/ 77.3%\r\n    return 3;\r\n\/\/  else if (val &lt; 75)  \/\/ 69.9%\r\n  return 4;    \r\n}\r\n\r\n\/\/ setup() \u3068\u3044\u3046\u540d\u524d\u306e\u5fc5\u8981\u3082\u306a\u3044\u306e\u3060\u304c\u3002\r\nvoid setup() {\r\n  cli();\r\n  DDRB = _BV(4);  \/\/ pwm\r\n  PORTB = 0;\r\n  ACSR |= 0x80;    \/\/ disable Analog Comparator.\r\n  ADCSRA &amp;= 0x7f;  \/\/ disable ADC\r\n  wdt_disable();\r\n  GTCCR = 0;\r\n  TCCR0A = 0;\r\n  TIMSK = 0;  \/\/ disable Timer0\/1 overflow interrupt.\r\n  PRR = 11; \/\/ ADC, TC1, USI\u3092\u505c\u6b62\u3002power down sleep\u4e2d\u306f\u95a2\u4fc2\u306a\u3044\u304c\u3002\r\n}\r\n\r\nISR (PCINT0_vect) { }\r\nint main() {\r\n  setup();\r\n  sei();\r\n  for(;;) {\r\n    GIMSK = 0x20; \/\/ set GIMASK PCIE bit.\r\n    PCMSK = 0x8;  \/\/ enable PCINT3 (PB3)\r\n    set_sleep_mode(SLEEP_MODE_PWR_DOWN);\r\n    sleep_enable();\r\n    sleep_cpu();\r\n    sleep_disable();\r\n    delay_ms(20);\r\n    if ((PINB &amp; _BV(3)) == 0)\r\n      continue;              \r\n    uint8_t buf[4] = {0};\r\n    int8_t key = read_key(buf[1]);\r\n    if (key &gt; 0) {\r\n      buf[0] = key;\r\n      send_frame(buf, 4);\r\n    }\r\n    delay_ms(10);\r\n  }\r\n}\r\n<\/pre>\n<p>ATtiny45V(Internal 1MHz) \u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u3068\u3057\u3066\u30d3\u30eb\u30c9\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u305f\u3002<\/p>\n<pre class=\"nums:false lang:default decode:true\">\u6700\u59274096\u30d0\u30a4\u30c8\u306e\u30d5\u30e9\u30c3\u30b7\u30e5\u30e1\u30e2\u30ea\u306e\u3046\u3061\u3001\u30b9\u30b1\u30c3\u30c1\u304c1234\u30d0\u30a4\u30c8\uff0830%\uff09\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\r\n\u6700\u5927256\u30d0\u30a4\u30c8\u306eRAM\u306e\u3046\u3061\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u304c2\u30d0\u30a4\u30c8\uff080%\uff09\u3092\u4f7f\u3063\u3066\u3044\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3067254\u30d0\u30a4\u30c8\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/pre>\n<p>avr-objdump \u3067\u898b\u305f\u3068\u3053\u308d\u30011234\u30d0\u30a4\u30c8\u306e\u30ed\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3046\u3061\u3001\u30b9\u30b1\u30c3\u30c1\u81ea\u4f53\u306f800\u30d0\u30a4\u30c8\u7a0b\u5ea6\u3067\u3001\u6b8b\u308a\u306e\u4e3b\u8981\u90e8\u5206\u306f\u639b\u3051\u7b97\u3084\u5272\u308a\u7b97\u306e\u305f\u3081\u306e\u30e9\u30f3\u30bf\u30a4\u30e0\u30e9\u30a4\u30d6\u30e9\u30ea\u3060\u3063\u305f\u3002ATtiny5\u30b7\u30ea\u30fc\u30ba\u306b\u306f\u4e57\u7b97\u547d\u4ee4\u304c\u306a\u3044\u3093\u3067\u3059\u306d\u3002\u307e\u305f\u3001\u30b9\u30bf\u30c3\u30af\u308220\u30d0\u30a4\u30c8\u7a0b\u5ea6\u306f\u4f7f\u3046\u3088\u3046\u3060\u304c\u3001SRAM\u306b\u306f\u307e\u3060\u4f59\u88d5\u304c\u3042\u308b\u3002<\/p>\n<p>pwm\u306b\u3088\u308b\u8d64\u5916\u7dda\u6ce2\u5f62\u306e\u4f5c\u6210\u306b\u3064\u3044\u3066\u306f\u3001\u524d\u306b\u8f09\u305b\u305f\u306e\u3068\u540c\u3058\u3088\u3046\u306b\u3057\u305f\u3002\u53d7\u4fe1\u5074\u306e\u90fd\u5408\u30671\u30d5\u30ec\u30fc\u30e0\u306f4\u30d0\u30a4\u30c8\u3068\u3057\u3066\u9001\u4fe1\u3057\u3066\u304a\u308a\u3001PRR\u306e\u64cd\u4f5c\u306b\u3088\u308a\u305d\u306e\u9593\u3060\u3051TC1\u30e6\u30cb\u30c3\u30c8\u306e\u52d5\u4f5c\u3092\u8a31\u53ef\u3057\u3066\u3044\u308b\u3002<\/p>\n<h5>\u5168\u4f53\u306e\u6d41\u308c<\/h5>\n<p>\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u306fmain() \u304b\u3089\u958b\u59cb\u3059\u308b\u3002\u307e\u305asetup() \u3067\u30dd\u30fc\u30c8\u3084\u30ec\u30b8\u30b9\u30bf\u306e\u521d\u671f\u5316\u3001\u4e0d\u8981\u306a\u5468\u8fba\u30c7\u30d0\u30a4\u30b9\u306e\u7121\u52b9\u5316\u3001\u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u306e\u7981\u6b62\u3092\u884c\u3044\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u306b\u5165\u308b\u3002<\/p>\n<p>\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u3067\u306f\u3001PB3\u306ePCI\u3092\u8a31\u53ef\u3057\u3066\u3059\u3050\u306b\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u306b\u5165\u308b\u3002\u3044\u305a\u308c\u304b\u306e\u30b9\u30a4\u30c3\u30c1\u306e\u72b6\u614b\u5909\u5316\u306b\u3088\u3063\u3066\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3059\u308b\u3068\u3001\u30b9\u30a4\u30c3\u30c1\u306e\u30d0\u30a6\u30f3\u30b9\u3092\u610f\u8b58\u3057\u305f20msec\u306e\u9045\u5ef6\u306e\u3042\u3068\u3067PB3\u306e\u72b6\u614b\u3092\u8aad\u307f\u3001\u8ad6\u7406L\u306a\u3089\u3070\u30b9\u30a4\u30c3\u30c1\u30aa\u30d5\u306b\u3088\u308b\u5fa9\u5e30\u306a\u306e\u3067\u3001\u4f55\u3082\u3057\u306a\u3044\u3067\u30eb\u30fc\u30d7\u3092\u7d9a\u884c\u3059\u308b\u3002<\/p>\n<p>\u8ad6\u7406H\u306a\u3089\u3070\u3001read_key(); \u306b\u3088\u308aPB3(ADC3)\u306e\u96fb\u5727\u3092\u8aad\u307f\u53d6\u3063\u3066\u30d5\u30eb\u30b9\u30b1\u30fc\u30eb(1023)\u306e\u4f55%\u306a\u306e\u304b\u3092\u8a08\u7b97\u3057\u3066\u3044\u308b\u3002\u623b\u308a\u5024\u304c\u30b9\u30a4\u30c3\u30c1\u306e\u756a\u53f7\u3001\u5f15\u6570\u306b\u306f\u5206\u5727\u7387 (\u30d1\u30fc\u30bb\u30f3\u30c8)\u304c\u5e30\u308b\u3002\u30b9\u30a4\u30c3\u30c1\u756a\u53f7\u304c\u53d6\u5f97\u3067\u304d\u305f\u5834\u5408\u306f\u3001\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u3068\u540c\u3058\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u30b9\u30a4\u30c3\u30c1\u756a\u53f7\u3068A\/D\u5909\u63db\u7d50\u679c\u3092\u9001\u4fe1\u3057\u3001\u30eb\u30fc\u30d7\u306e\u5148\u982d\u306b\u623b\u308b\u3002<\/p>\n<h5>read_key() \u306b\u3064\u3044\u3066<\/h5>\n<p>\u307e\u305a\u306fPRR\u3092\u4f7f\u3063\u3066ADC\u306e\u52d5\u4f5c\u8a31\u53ef\u3092\u884c\u3044\u3001ADC\u306e\u96fb\u5727\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9(Vcc = 0)\u3068\u30b7\u30f3\u30b0\u30eb\u30a8\u30f3\u30c9\u3067\u306e\u5909\u63db\u5bfe\u8c61\u30c1\u30e3\u30cd\u30eb(ADC3 = 3) \u3092<em>ADMUX<\/em>\u306b\u6307\u5b9a\u3057\u3066\u3044\u308b\u3002\u305d\u3057\u3066\u3001<em>ADCSRC(\u00a0ADC Control and Status Register A) \u306b\u5bfe\u3057\u3066<\/em>ADC\u306e\u52d5\u4f5c\u8a31\u53ef(MSB = 1)\u3068\u3001ADC\u30af\u30ed\u30c3\u30af\u306e\u30d7\u30ea\u30b9\u30b1\u30fc\u30e9(3 = 1\/8 clock) \u3092\u6307\u5b9a\u3002\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u306b\u3088\u308c\u3070\u3001\u7cbe\u5ea6\u3092\u6c42\u3081\u308b\u306a\u3089ADC\u30af\u30ed\u30c3\u30af\u309250k\uff5e200kHz\u3067\u4f7f\u3048\u3068\u3042\u308b\u306e\u3067125kHz\u3068\u3057\u305f\u3002<\/p>\n<p>ADCSRA\u306eADSC\u30d3\u30c3\u30c8(\u30d3\u30c3\u30c86) \u30921\u306b\u3059\u308b\u3053\u3068\u3067\u5909\u63db\u304c\u958b\u59cb\u3059\u308b\u3002A\/D\u5909\u63db\u306b\u8981\u3059\u308b\u6642\u9593\u306f\u6700\u60aa25\u30af\u30ed\u30c3\u30af\u3001\u901a\u5e3813\u30af\u30ed\u30c3\u30af\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067104\uff5e200\u03bcsec\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u3002\u5909\u63db\u304c\u7d42\u4e86\u3059\u308b\u3068ADSC\u30d3\u30c3\u30c8\u304c0\u306b\u306a\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306f\u3001A\/D\u5909\u63db\u30923\u56de\u3084\u3063\u3066\u305d\u306e\u5e73\u5747\u5024\u3092\u5f97\u3066\u3044\u308b\u304c\u3001\u30b9\u30a4\u30c3\u30c1\u306e\u30d0\u30a6\u30f3\u30b9\u306b\u3088\u3063\u3066\u5b9f\u969b\u306f\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30d5\u306a\u306e\u306b\u5909\u63db\u3092\u958b\u59cb\u3057\u3066\u3057\u307e\u3063\u305f\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u305d\u306e\u305f\u3081\u6bce\u56de\u8aad\u307f\u53d6\u308a\u5024\u3092\u8a55\u4fa1\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<p>3\u56de\u306eA\/D\u5909\u63db\u304c\u7d42\u308f\u308b\u3068\u3001ADC\u3092\u52d5\u4f5c\u7981\u6b62\u3057\u3066\u304b\u3089PRR\u3092\u5143\u306b\u623b\u3057(ADC\u30af\u30ed\u30c3\u30af\u505c\u6b62)\u3001\u5206\u5727\u7387\u3092\u6c42\u3081\u3066\u304b\u3089\u3069\u306e\u30b9\u30a4\u30c3\u30c1\u304c\u30aa\u30f3\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u304b\u3092\u8abf\u3079\u3066\u3044\u308b\u3002\u5ff5\u306e\u305f\u3081\u6bd4\u8f03\u306e\u7bc4\u56f2\u306f\u5e83\u3081\u306b\u3057\u305f\u3002<\/p>\n<h5>\u5b9f\u884c\u7d50\u679c<\/h5>\n<p>\u30b9\u30a4\u30c3\u30c11\u3092\u62bc\u3057\u3066\u307f\u308b\u3068\u3001PC\u5074\u306e\u30b7\u30ea\u30a2\u30eb\u7aef\u672b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u305f\u3002( <a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?page_id=7524\" target=\"_blank\" rel=\"noopener\">Arduino nano\u3092\u4f7f\u3063\u305f\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u53d7\u4fe1\u5668\u306e\u6539\u8a02\u7248\u30b9\u30b1\u30c3\u30c1<\/a> \u306b\u3088\u308b\u51fa\u529b)\u3002<\/p>\n<pre class=\"lang:default decode:true\">use T = 560 usec.\r\n\r\n--- LEADER ---\r\n1 : high = 9016, low = 4556, T:16, 8, bit=0\r\n\r\n--- DATA ---\r\n2 : high = 568, low = 1768, T:1, 3, bit=1\r\n3 : high = 568, low = 672, T:1, 1, bit=0\r\n4 : high = 540, low = 676, T:1, 1, bit=0\r\n5 : high = 540, low = 680, T:1, 1, bit=0\r\n6 : high = 544, low = 672, T:1, 1, bit=0\r\n7 : high = 536, low = 652, T:1, 1, bit=0\r\n8 : high = 564, low = 648, T:1, 1, bit=0\r\n9 : high = 568, low = 656, T:1, 1, bit=0\r\n10 : high = 568, low = 640, T:1, 1, bit=0\r\n11 : high = 568, low = 648, T:1, 1, bit=0\r\n12 : high = 568, low = 1764, T:1, 3, bit=1\r\n13 : high = 560, low = 672, T:1, 1, bit=0\r\n14 : high = 540, low = 636, T:1, 1, bit=0\r\n15 : high = 564, low = 1800, T:1, 3, bit=1\r\n16 : high = 548, low = 1768, T:1, 3, bit=1\r\n17 : high = 564, low = 672, T:1, 1, bit=0\r\n18 : high = 540, low = 664, T:1, 1, bit=0\r\n19 : high = 544, low = 640, T:1, 1, bit=0\r\n20 : high = 560, low = 648, T:1, 1, bit=0\r\n21 : high = 560, low = 636, T:1, 1, bit=0\r\n22 : high = 568, low = 640, T:1, 1, bit=0\r\n23 : high = 564, low = 644, T:1, 1, bit=0\r\n24 : high = 568, low = 668, T:1, 1, bit=0\r\n25 : high = 540, low = 672, T:1, 1, bit=0\r\n26 : high = 544, low = 644, T:1, 1, bit=0\r\n27 : high = 564, low = 640, T:1, 1, bit=0\r\n28 : high = 564, low = 644, T:1, 1, bit=0\r\n29 : high = 560, low = 640, T:1, 1, bit=0\r\n30 : high = 564, low = 640, T:1, 1, bit=0\r\n31 : high = 564, low = 664, T:1, 1, bit=0\r\n32 : high = 536, low = 644, T:1, 1, bit=0\r\n33 : high = 564, low = 640, T:1, 1, bit=0\r\n\r\nTransfer DATA = 01 64 00 00 \r\n\r\n---- END ----\r\n<\/pre>\n<p>Trasfer DATA\u306e1\u30d0\u30a4\u30c8\u76ee\u304c\u30b9\u30a4\u30c3\u30c1\u306e\u756a\u53f7\u30012\u756a\u76ee\u306e64 (16\u9032)\u304c\u5206\u5727\u7387\u306a\u306e\u3067\u3001100%\u3060\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308b\u3002\u96fb\u6e90\u96fb\u5727\u3092+5V\u304b\u3089+2.0V\u307e\u3067\u5909\u66f4\u3057\u3066\u307f\u305f\u304c\u3001\u5404\u30b9\u30a4\u30c3\u30c1\u3068\u3082\u6570\u30d1\u30fc\u30bb\u30f3\u30c8\u306e\u8aa4\u5dee\u304c\u751f\u3058\u308b\u3053\u3068\u304c\u3042\u308b\u3082\u306e\u306e\u3001\u30b9\u30a4\u30c3\u30c1\u756a\u53f7\u3092\u53d6\u308a\u9055\u3048\u308b\u3088\u3046\u306a\u3053\u3068\u306f\u306a\u304b\u3063\u305f\u3002<\/p>\n<h2>\u304d\u3087\u3046\u306e\u307e\u3068\u3081<\/h2>\n<p>\u9001\u51fa\u3059\u308b\u30c7\u30fc\u30bf\u3092\u5165\u308c\u3066\u3084\u308c\u3070\u30b7\u30f3\u30d7\u30eb\u306a\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u7a0b\u5ea6\u307e\u3067\u306e\u3053\u3068\u306f\u3067\u304d\u305f\u3002\u3082\u3068\u3082\u3068\u3001\u5b9f\u7269\u306e\u4ee3\u66ff\u54c1\u3067\u306f\u306a\u304f\u7279\u6b8a\u306a\u6a5f\u80fd\u3092\u3082\u3064\u30ea\u30e2\u30b3\u30f3\u3092\u4f5c\u308d\u3046\u3068\u601d\u3063\u3066\u59cb\u3081\u305f\u6e96\u5099\u3060\u3063\u305f\u306e\u3067\u3001\u30bf\u30a4\u30de\u30fc\u95a2\u4fc2\u306e\u304a\u52c9\u5f37\u306b\u6642\u9593\u3092\u4f7f\u3063\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n<h3>\u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u30bf\u30a4\u30de\u30fc\u306b\u3088\u308b\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u306e\u5fa9\u5e30<\/h3>\n<p>\u4eca\u56de\u306f\u8a66\u3057\u3066\u307f\u306a\u304b\u3063\u305f\u304c\u3001 \u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u30bf\u30a4\u30de\u30fc\u3092\u4f7f\u3063\u305f\u5272\u8fbc\u307f\u306b\u3088\u3063\u3066\u4e00\u5b9a\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308b\u3002<br \/>\n\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u3067\u306f\u3001\u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u30bf\u30a4\u30de\u30fc\u306e\u52d5\u4f5c\u3092\u7981\u6b62\u3057\u3066\u5b9f\u884c\u3057\u3066\u3044\u308b\u306e\u3067\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u6642\u306e\u6d88\u8cbb\u96fb\u6d41\u306f0.2\u03bcA\u4ee5\u4e0b\u3060\u304c\u3001\u5e38\u306b\u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u52d5\u4f5c\u3092\u8a31\u53ef\u3057\u305f\u307e\u307e\u3060\u30684\u03bcA\u5f31\u306b\u306a\u308b\u3002\u305d\u306e\u3042\u305f\u308a\u304c\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u4e00\u5b9a\u6642\u9593\u5f8c\u306b\u5fa9\u5e30\u3055\u305b\u305f\u3044\u3068\u304d\u3060\u3051\u30a6\u30a9\u30c3\u30c1\u30c9\u30c3\u30b0\u52d5\u4f5c\u3092\u8a31\u53ef\u3059\u308b\u306a\u3069\u3057\u3066\u3084\u308c\u3070\u3001\u30bf\u30a4\u30de\u30fc\u3092\u4f7f\u308f\u306a\u304f\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\u3001\u8a66\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u305d\u3046\u306a\u308b\u3068\u3001Arduino\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30ea\u30f3\u30af\u3057\u3066\u3082\u554f\u984c\u306a\u3044\u3088\u3046\u306a\u6c17\u3082\u3059\u308b\u3002\u3061\u3087\u3063\u3068\u56de\u308a\u9053\u3057\u3066\u3057\u307e\u3063\u305f\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u4e00\u3064\u77e5\u898b\u3092\u5f97\u305f\u3068\u3044\u3046\u3053\u3068\u306b\u3057\u3088\u3046\u3002<\/p>\n<h3>\u304a\u307e\u3051\u3002\u5c0f\u7269\u64ae\u5f71\u7528\u306e\u30e9\u30a4\u30c8<\/h3>\n<p>\u3053\u306e\u6295\u7a3f\u306e\u5148\u982d\u306b\u8f09\u305b\u305fATtiny45V\u306e\u5199\u771f\u306f\u3001OM-D E-M5mkII\u306b\u3001MZD30mm\u30de\u30af\u30ed\u3092\u4ed8\u3051\u3066\u64ae\u5f71\u3057\u305f\u3082\u306e\u3060\u3051\u3069\u3001\u30c7\u30d0\u30a4\u30b9\u8868\u9762\u306e\u30de\u30fc\u30ad\u30f3\u30b0\u304c\u306f\u3063\u304d\u308a\u5199\u3089\u306a\u304f\u3066\u3061\u3087\u3063\u3068\u82e6\u52b4\u3057\u305f\u3002\u4e0a\u304b\u3089\u306e\u5149\u3092\u53cd\u5c04\u3057\u305a\u3089\u304f\u3057\u3066\u3044\u308b\u306e\u3060\u308d\u3046\u304b\u3002<\/p>\n<figure id=\"attachment_7593\" aria-describedby=\"caption-attachment-7593\" style=\"width: 414px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/ee57da16e6f78c89b03d887dcdac80f2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7593\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2018\/07\/ee57da16e6f78c89b03d887dcdac80f2-414x552.jpg\" alt=\"\" width=\"414\" height=\"552\" \/><\/a><figcaption id=\"caption-attachment-7593\" class=\"wp-caption-text\">\u64ae\u5f71\u98a8\u666f<\/figcaption><\/figure>\n<p>\u6614\u306e\u80c3\u30ab\u30e1\u30e9\u98a8\u306e\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u30a2\u30fc\u30e0\u306e\u5148\u306b\u30c1\u30c3\u30d7\u578b\u306e\u767d\u8272LED\u306e\u3064\u3044\u305fUSB\u30e9\u30a4\u30c8(\u9001\u6599\u7b49\u8fbc\u307f\u30671\u672c\u3042\u305f\u308a200\u5186\u7a0b\u5ea6)\u30924\u672c\u4f7f\u3044\u3001\u6a2a\u304b\u3089\u5149\u3092\u5f53\u3066\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30fc\u30ad\u30f3\u30b0\u304c\u8aad\u3081\u308b\u7a0b\u5ea6\u306b\u306f\u306a\u3063\u305f\u3002<br \/>\n\u3053\u3046\u3044\u3063\u305f\u5f62\u72b6\u306e\u30de\u30af\u30ed\u64ae\u5f71\u7528\u30e9\u30a4\u30c8\u3092\u4f5c\u308a\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3060\u3051\u3069\u3001\u5b89\u304f\u3066\u7d30\u3044\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u30a2\u30fc\u30e0\u304c\u306a\u304b\u306a\u304b\u898b\u3064\u304b\u3089\u306a\u3044\u3002200\u5186\u306a\u3089\u5206\u89e3\u3057\u3066\u7d20\u6750\u306b\u3057\u3066\u3082\u3044\u3044\u304b\u306a\u3068\u601d\u3063\u3066\u8cfc\u5165\u3057\u305f\u306e\u3060\u3051\u3069\u30014\u53e3\u306eUSB\u30cf\u30d6(\u30bb\u30eb\u30d5\u30d1\u30ef\u30fc)\u3092\u96fb\u6e90\u306b\u3059\u308b\u3053\u3068\u3067\u305d\u306e\u307e\u307e\u4f7f\u3048\u305f\u3002\u5206\u89e3\u3059\u308b\u306e\u306f\u58ca\u308c\u3066\u304b\u3089\u306b\u3059\u308b\u4e88\u5b9a\u3002<\/p>\n<figure id=\"attachment_5315\" aria-describedby=\"caption-attachment-5315\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/c922eed8c328464296da72ce1c1e703f.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-5315\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2016\/11\/c922eed8c328464296da72ce1c1e703f-552x414.jpg\" alt=\"E-PM2 + MZD30mm F3.5\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-5315\" class=\"wp-caption-text\">E-PM2 + MAL-1 + MZD30mm F3.5<\/figcaption><\/figure>\n<p>\u3053\u3061\u3089\u306f\u4ee5\u524d\u306b\u3082\u8f09\u305b\u305f\u3082\u306e\u3060\u304c\u3001E-PM2\u306b\u30aa\u30ea\u30f3\u30d1\u30b9\u7d14\u6b63\u306e\u30de\u30af\u30ed\u30a2\u30fc\u30e0\u30e9\u30a4\u30c8 MAL-1\u3092\u88c5\u7740\u3057\u3066\u4f7f\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u3002MAL-1\u3082\u30c7\u30d0\u30a4\u30b9\u306e\u64ae\u5f71\u306b\u306f\u91cd\u5b9d\u3057\u3066\u3044\u308b\u306e\u3060\u3051\u3069\u3001E-PM2\u304b\u3089SD\u30ab\u30fc\u30c9\u3092\u629c\u304f\u3068\u304d\u306f\u30ab\u30e1\u30e9\u3092\u4e09\u811a\u306e\u96f2\u53f0\u304b\u3089\u5916\u3059\u5fc5\u8981\u304c\u3042\u3063\u3066\u5104\u52ab\u3067\u3042\u308b\u3002\u30aa\u30ea\u30f3\u30d1\u30b9\u7d14\u6b63\u306ePC\u63a5\u7d9a\u30b1\u30fc\u30d6\u30eb(\u5909\u306a\u30b3\u30cd\u30af\u30bf\u4ed8\u304d)\u3082\u9577\u3055\u306b\u5236\u9650\u304c\u3042\u308b\u306e\u3067\u30ab\u30e1\u30e9\u306e\u5834\u6240\u3092\u9078\u3093\u3067\u3057\u307e\u3046\u3002<\/p>\n<p>\u6b8b\u5ff5\u306a\u3053\u3068\u306bMAL-1\u306f\u6700\u8fd1\u306eOM-D\u3067\u306f\u4f7f\u3048\u306a\u3044\u3002\u3069\u3046\u3084\u3089MAL-1\u81ea\u4f53\u3082\u88fd\u9020\u7d42\u4e86\u3057\u3066\u3044\u308b\u3088\u3046\u3060(\u305d\u308a\u3083\u3001\u305d\u3046\u3060\u308d\u3046\u3051\u3069)\u3002\u4ee3\u308f\u308a\u306b\u306a\u308b\u3082\u306e\u3092\u3044\u308d\u3044\u308d\u3068\u7269\u8272\u4e2d\u306a\u306e\u3060\u3051\u3069\u3001\u306a\u304b\u306a\u304b\u5b89\u304f\u3066\u826f\u3055\u305d\u3046\u306a\u3082\u306e\u304c\u306a\u3044\u3002\u30ea\u30f3\u30b0\u72b6\u306e\u30e9\u30a4\u30c8\u306f\u3001\u3053\u3053\u307e\u3067\u8fd1\u63a5\u3057\u305f\u64ae\u5f71\u3067\u306f\u4e2d\u592e\u90e8\u306b\u5149\u304c\u5f53\u305f\u3089\u306a\u3044\u304b\u3089\u5411\u3044\u3066\u3044\u306a\u3044\u3088\u3046\u306b\u601d\u3046\u3002MAL-1\u3092\u6240\u6709\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u3001E-PM2\u3092\u4f7f\u3044\u7d9a\u3051\u308b\u7406\u7531\u306e\u4e00\u3064\u306b\u306a\u3063\u3066\u306f\u3044\u308b\u306e\u3060\u304c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 ATtiny85\/45\u3092\u4f7f\u3063\u3066\u5bb6\u96fb\u7528\u306e\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u3092\u4f5c\u308b\u306b\u3042\u305f\u3063\u3066\u4ee5\u4e0b\u3092\u8a66\u3057\u3066\u307f\u305f\u3002 \u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f\u3067\u30d1\u30ef\u30fc\u30c0\u30a6\u30f3\u30b9\u30ea\u30fc\u30d7\u304b\u3089\u5fa9\u5e30\u3059\u308b\u3002 \u62b5\u6297\u5206\u5727\u3068A\/D\u30b3\u30f3\u30d0\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3001\u62bc\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u3092\u8b58\u5225\u3059\u308b\u3002 Ar &hellip; <a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=7567\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">ATtiny85\/45 \u30d4\u30f3\u30c1\u30a7\u30f3\u30b8\u5272\u8fbc\u307f\u3001\u30a2\u30ca\u30ed\u30b0\u5f0f\u30ad\u30fc\u8b58\u5225\u3001\u30a2\u30a4\u30c9\u30eb\u30b9\u30ea\u30fc\u30d7<\/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,95,86],"class_list":["post-7567","post","type-post","status-publish","format-standard","hentry","category-programming","tag-arduino","tag-attiny","tag-remocon"],"_links":{"self":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7567","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=7567"}],"version-history":[{"count":0,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7567\/revisions"}],"wp:attachment":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}