
{"id":6130,"date":"2017-08-07T18:20:07","date_gmt":"2017-08-07T09:20:07","guid":{"rendered":"https:\/\/okiraku-camera.tokyo\/blog\/?p=6130"},"modified":"2017-08-15T12:41:37","modified_gmt":"2017-08-15T03:41:37","slug":"%e9%9d%99%e9%9b%bb%e5%ae%b9%e9%87%8f%e3%82%bf%e3%83%83%e3%83%81%e3%82%ad%e3%83%bc%e3%82%92arduino-pro-mini%e3%81%ab%e6%8e%a5%e7%b6%9a","status":"publish","type":"post","link":"https:\/\/okiraku-camera.tokyo\/blog\/?p=6130","title":{"rendered":"\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30ad\u30fc\u3092Arduino PRO MINI\u306b\u63a5\u7d9a"},"content":{"rendered":"<p>amazon\u3067\u96fb\u5b50\u90e8\u54c1\u3092\u3042\u3055\u3063\u3066\u3044\u308b\u3068\u304d\u300116\u30ad\u30fc\u69cb\u6210\u306e\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u76ee\u306b\u3064\u3044\u305f\u306e\u3067\u3064\u3044\u3067\u306b\u8cfc\u5165 (199\u5186)\u3002\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306e\u64cd\u4f5c\u90e8\u306b\u3044\u3044\u304b\u306a\u3068\u601d\u3063\u3066\u3001\u3055\u3063\u305d\u304f5V\u52d5\u4f5c\u306eArduino PRO MINI (The Simple) \u306b\u3064\u306a\u3044\u3067\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/2543de1d526cc16f90939f2435c7b319.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-6149\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/2543de1d526cc16f90939f2435c7b319-552x414.jpg\" alt=\"\u30bf\u30c3\u30c1\u30ad\u30fc\u30dc\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\" width=\"552\" height=\"414\" \/><\/a><\/p>\n<h2>TonTouch\u2122 IC\u00a0TTP229<\/h2>\n<p>TonTouch\u2122 IC \u306eTTP229-BSF (8229BSF)\u304c\u8f09\u3063\u3066\u3044\u308b\u3002 TonTouch\u2122 IC\u3068\u3044\u3046\u306e\u306f\u53f0\u6e7e\u306eTonTek\u793e\u304c\u5546\u6a19\u3092\u3082\u3064\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30d1\u30c3\u30c9\u306e\u5236\u5fa1\u7528IC\u306e\u3088\u3046\u3067\u3042\u308b\u3002<\/p>\n<p>\u30a4\u30f3\u30c9\u306b\u3042\u308b\u00a0<a href=\"http:\/\/www.sunrom.com\/p\/ttp229-bsf-8229bsf-ssop28-spi\">sunrom\u793e\u306e\u30da\u30fc\u30b8<\/a>\u304b\u3089\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\u80fd\u3002\u4eca\u56de\u8cfc\u5165\u3057\u305f\u88fd\u54c1\u306f\u3001\u3053\u306eIC\u306e<a href=\"http:\/\/www.sunrom.com\/p\/816-channel-capacitive-touch-module-ttp229\">\u30c7\u30e2\u7528\u57fa\u677f<\/a>\u3068\u3057\u3066\u7528\u610f\u3055\u308c\u305f\u3082\u306e\u306e\u3088\u3046\u3067\u3001\u540c\u793e\u306e\u30b5\u30a4\u30c8\u304b\u3089\u56de\u8def\u56f3\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\u80fd\u3060\u3063\u305f\u3002<\/p>\n<p>\u30b5\u30d5\u30a3\u30c3\u30af\u30b9\u9055\u3044\u306eTTP229-L\u304c\u5916\u90e8\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068\u3057\u3066I2C\u3092\u5099\u3048\u3066\u3044\u308b\u306e\u306b\u5bfe\u3057\u3001\u3053\u306e\u57fa\u677f\u306b\u8f09\u3063\u3066\u3044\u308bTTP229-B\u306f\u72ec\u81ea\u306e2\u7dda\u5f0f\u30b7\u30ea\u30a2\u30eb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u3082\u3063\u3066\u3044\u308b\u3002\u306a\u306e\u3067I2C\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u305f\u63a5\u7d9a\u306f\u3067\u304d\u306a\u3044\u304b\u3089\u3001\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u8aad\u3080\u3068\u304d\u306b\u306f\u30c7\u30d0\u30a4\u30b9\u540d\u306e\u30b5\u30d5\u30a3\u30c3\u30af\u30b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3060\u308d\u3046\u3002<\/p>\n<p>\u3053\u306e\u57fa\u677f\u306fTTP229-B\u3068\u3044\u3046IC\u306e\u30c7\u30e2\u7528\u3067\u3001\u5b9f\u7528\u7684\u306a16\u30ad\u30fc\u306e\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3044\u3046\u3088\u308a\u3001IC\u306e\u6a5f\u80fd\u306e\u78ba\u8a8d\u7528\u3068\u3057\u3066\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001\u308f\u3056\u308f\u305612\u30d4\u30f3\u306e\u30d4\u30f3\u30d8\u30c3\u30c0\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3002\u3053\u306e\u3046\u3061\u306e8\u30d4\u30f3(OUT1\uff5eOUT8)\u306f\u30019\uff5e16\u3068\u5370\u5b57\u3055\u308c\u3066\u3044\u308b8\u3064\u30ad\u30fc\u306e\u72b6\u614b(\u30aa\u30f3\u304b\u30aa\u30d5\u304b)\u3092\u76f4\u63a5\u30de\u30a4\u30b3\u30f3\u306eIO\u30dd\u30fc\u30c8\u3067\u8aad\u3080\u305f\u3081\u306b\u7528\u3044\u308b\u3088\u3046\u3060\u3002\u30ad\u30fc1\uff5e8\u306b\u3064\u3044\u3066\u306f\u3001SCL\u3068SDO\u306e2\u30d4\u30f3\u3092\u4f7f\u3063\u305f\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u8aad\u3081\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u96fb\u6e90\u30d4\u30f3(VCC)\u306b\u306f\u3001+2.4\uff5e+5.5V\u3092\u4e0e\u3048\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3001IC\u5185\u90e8\u306e\u30ec\u30ae\u30e5\u30ec\u30fc\u30bf\u306b\u3088\u3063\u3066\u5fc5\u8981\u306a\u96fb\u5727\u3092\u751f\u6210\u3057\u3066\u3044\u308b\u3068\u306e\u3053\u3068\u3002<\/p>\n<p>\u57fa\u677f\u4e0a\u306e\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2(P1\u3001P2)\u306b\u306fIC\u306eTP0\uff5eTP7\u304c\u5f15\u304d\u51fa\u3055\u308c\u3066\u304a\u308a\u3001\u51fa\u8377\u6642\u306b\u306f\u3059\u3079\u3066\u30aa\u30fc\u30d7\u30f3\u72b6\u614b\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u30b8\u30e3\u30f3\u30d1\u3059\u308b\u30681M\u03a9\u306e\u62b5\u6297\u3092\u4ecb\u3057\u3066GND\u306b\u63a5\u7d9a\u3055\u308c\u308b\u3002\u96fb\u6e90\u6295\u5165\u6642\u306eTP0\uff5eTP7\u306e\u72b6\u614b(\u30aa\u30fc\u30d7\u30f3=1, \u30af\u30ed\u30fc\u30ba=0) \u306b\u3088\u3063\u3066IC\u306e\u6319\u52d5\u3092\u8a2d\u5b9a\u53ef\u80fd\u3067\u300116\u500b\u306e\u30ad\u30fc\u3059\u3079\u3066\u3092\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3067\u8aad\u3093\u3060\u308a\u3001\u901a\u4fe1\u6642\u306e\u8ad6\u7406\u3092\u53cd\u8ee2\u3057\u305f\u308a\u3001\u30ad\u30fc\u30b9\u30ad\u30e3\u30f3\u306e\u30ec\u30fc\u30c8\u3092\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u8a73\u3057\u304f\u306f\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u53c2\u7167\u306e\u3053\u3068\u3002<\/p>\n<figure id=\"attachment_6167\" aria-describedby=\"caption-attachment-6167\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/73162b8fedab5f4bf289b331436c03de.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6167\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/73162b8fedab5f4bf289b331436c03de-552x414.jpg\" alt=\"\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-6167\" class=\"wp-caption-text\">\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2<\/figcaption><\/figure>\n<p>\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2\u5468\u8fba\u3092\u62e1\u5927\u3057\u305f\u3068\u3053\u308d\u3002\u53f3\u5074\u306eIC\u304cTTP229B\u3001\u5de6\u5074\u306eR1\u3068R2\u304c1M\u03a9\u306e\u96c6\u5408\u62b5\u6297\u3001\u5de6\u7aef\u306eR3\u3068D1\u306fLED\u304a\u3088\u3073\u76f4\u5217\u62b5\u6297(1K\u03a9)\u3002<\/p>\n<p>\u4eca\u56de\u306f\u51fa\u8377\u6642\u306e\u307e\u307e\u306e\u72b6\u614b\u3067\u3001\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u4f7f\u3063\u30668\u3064\u306e\u30ad\u30fc(\u30ad\u30fc1\uff5e\u30ad\u30fc8) \u3092\u8aad\u307f\u53d6\u3063\u3066\u3001\u30bf\u30c3\u30c1\u3055\u308c\u305f\u30ad\u30fc\u306e\u756a\u53f7\u3092\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u3092\u76ee\u6a19\u3068\u3057\u305f\u3002\u6b21\u306e\u6bb5\u968e\u3067\u306f\u3001\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2\u306b\u30d8\u30c3\u30c0\u3092\u7acb\u3066\u3066\u8a2d\u5b9a\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3001\u306a\u304a\u304b\u3064Arduino \u306e\u30b9\u30ea\u30fc\u30d7\u30e2\u30fc\u30c9\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u4e88\u5b9a\u3002<\/p>\n<h2>\u56de\u8def\u56f3<\/h2>\n<p>+5V\u300116MHz\u52d5\u4f5c\u306eArduino PRO MINI( The Simple) \u306b\u3001USB-\u30b7\u30ea\u30a2\u30eb\u5909\u63db\u7528\u306eAE-FT231X\u3092\u63a5\u7d9a\u3057\u3001PRO MINI\u306eD2\u3092SDO\u3001D4\u3092SCL\u306b\u63a5\u7d9a\u3057\u305f\u3002OUT1\uff5eOUT8\u306f\u4f7f\u308f\u306a\u3044\u3002<\/p>\n<figure id=\"attachment_6155\" aria-describedby=\"caption-attachment-6155\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/A_PRO_MINI-TPP229B-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6155\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/A_PRO_MINI-TPP229B-1-552x345.png\" alt=\"A_PRO_MINI-TPP229B-1\" width=\"552\" height=\"345\" \/><\/a><figcaption id=\"caption-attachment-6155\" class=\"wp-caption-text\">A_PRO_MINI-TTP229B-1<\/figcaption><\/figure>\n<p>PRO MINI\u304a\u3088\u3073TTP229\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u96fb\u6e90\u306f\u3001AE-FT231X\u304b\u3089(\u3064\u307e\u308aPC\u306eUSB\u304b\u3089)\u3082\u3089\u3046\u3053\u3068\u306b\u3057\u305f\u3002\u52d5\u4f5c\u6642\u306e\u5168\u4f53\u306e\u6d88\u8cbb\u96fb\u6d41\u306f\u7d0420mA\u3060\u3063\u305f\u3002\u4eca\u56de\u4f7f\u3063\u305fArduino PRO MINI\u306f\u3001\u88cf\u306bThe Simple\u3068\u66f8\u304b\u308c\u305f\u5b89\u3044\u30e4\u30c4\u3067\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=5166\">\u4ee5\u524dPOWER ON LED\u7528\u306e\u76f4\u5217\u62b5\u6297\u3092\u5916\u3057\u305f<\/a>\u3082\u306e\u3002<\/p>\n<p>TTP229B\u306eSDO\u306f\u3001\u30ad\u30fc\u30bf\u30c3\u30c1\u3092\u691c\u51fa\u3057\u30c7\u30fc\u30bf\u3092\u9001\u51fa\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u308b\u3068\u30a2\u30af\u30c6\u30a3\u30d6\u30ec\u30d9\u30eb\u306b\u306a\u308b(\u30a2\u30af\u30c6\u30a3\u30d6L\u304b\u30a2\u30af\u30c6\u30a3\u30d6H\u304b\u306f\u3001\u30b8\u30e3\u30f3\u30d1\u3067\u5909\u66f4\u53ef\u80fd\u3002\u51fa\u8377\u72b6\u614b\u3067\u306f\u30a2\u30af\u30c6\u30a3\u30d6L)\u3002SDO\u3092Arduino \u306eD2\u306b\u3064\u306a\u3044\u3060\u306e\u306f\u3001\u30a8\u30c3\u30b8\u30bb\u30f3\u30b9\u304b\u30ec\u30d9\u30eb\u30bb\u30f3\u30b9\u306e\u5272\u8fbc\u307f\u8981\u56e0\u3068\u3057\u3066\u7528\u3044\u308b\u3053\u3068\u3092\u610f\u56f3\u3057\u305f\u304b\u3089(\u4eca\u56de\u306f\u5272\u308a\u8fbc\u307f\u306f\u4f7f\u308f\u306a\u3044)\u3002<\/p>\n<figure id=\"attachment_6163\" aria-describedby=\"caption-attachment-6163\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/89da01f74e17a2f7945b3289b2ffa146.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6163\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/89da01f74e17a2f7945b3289b2ffa146-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-6163\" class=\"wp-caption-text\">\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u3001PRO MINI\u3001FT231X<\/figcaption><\/figure>\n<p>\u3053\u3046\u3044\u3063\u305f\u69cb\u6210\u306b\u306a\u3063\u305f\u3002\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u88cf\u306b\u306f\u4f55\u304b\u306e\u30c7\u30d0\u30a4\u30b9\u304c\u5165\u3063\u3066\u3044\u305f\u9759\u96fb\u9632\u6b62\u888b\u3092\u30bb\u30ed\u30c6\u30fc\u30d7\u3067\u8cbc\u308a\u4ed8\u3051\u3066\u3042\u308b\u3002<\/p>\n<h2>\u30d7\u30ed\u30b0\u30e9\u30e0<\/h2>\n<p>\u4eca\u56de\u306e\u30b9\u30b1\u30c3\u30c1\u306fTTP229B\u304b\u3089\u3082\u3089\u3063\u305f\u30ad\u30fc\u306e\u5185\u5bb9\u3092\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u306b\u8868\u793a\u3059\u308b\u3060\u3051\u306a\u306e\u3067\u3001TTP229B\u3068\u306e\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u78ba\u8a8d\u304c\u4e3b\u773c\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<h3>\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u30c1\u30e3\u30fc\u30c8<\/h3>\n<p>\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u6642\u306e\u30bf\u30a4\u30df\u30f3\u30b0(\u30a2\u30af\u30c6\u30a3\u30d6L\u51fa\u529b\u30018\u30ad\u30fc\u51fa\u529b)\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u51fa\u8377\u6642\u8a2d\u5b9a\u306e\u30a2\u30af\u30c6\u30a3\u30d6L\u51fa\u529b\u3092\u4f7f\u3046\u5834\u5408\u3001TTP229\u306f\u521d\u671f\u5316\u5f8cSDO == H\u3092\u51fa\u529b\u3059\u308b\u3002\u30de\u30a4\u30b3\u30f3\u5074(Arduino\u5074)\u3082\u521d\u671f\u5316\u6642\u306bSCL == H \u3068\u3057\u3066\u304a\u304f\u3002<\/p>\n<figure id=\"attachment_6156\" aria-describedby=\"caption-attachment-6156\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/TP299_Serial_timingActive-L-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6156\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/TP299_Serial_timingActive-L-1-552x129.png\" alt=\"\" width=\"552\" height=\"129\" \/><\/a><figcaption id=\"caption-attachment-6156\" class=\"wp-caption-text\">TP229B\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u56f3(\u30a2\u30af\u30c6\u30a3\u30d6L\u30018\u30ad\u30fc\u51fa\u529b)<\/figcaption><\/figure>\n<ul>\n<li>DV (Data Valid) : 1\u30ad\u30fc\u5206\u306e\u30c7\u30fc\u30bf\u304c\u7528\u610f\u3067\u304d\u308b\u3068\u3001\u7d0490\u03bc\u79d2\u306e\u671f\u9593\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u72b6\u614b\u3068\u306a\u308b(\u56f3\u3067\u306fL\u30ec\u30d9\u30eb)\u3002\u3053\u308c\u3092\u691c\u51fa\u3057\u305f\u3089\u3001Tw(10\u03bcsec min.) \u5f8c\u304b\u3089SCL\u306e\u99c6\u52d5\u3092\u958b\u59cb\u3059\u308b\u3002<\/li>\n<li>F_SCL : SCL\u306e\u5468\u6ce2\u6570\u3092\u8868\u3057\u3066\u304a\u308a\u30011KHz (min.)\uff5e512KHz (max.)\u3068\u306a\u3063\u3066\u3044\u308b\u30021\u5468\u671f\u306e\u6642\u9593\u306b\u76f4\u3059\u3068 1msec\uff5e2\u03bcsec \u306e\u7bc4\u56f2\u306e\u30af\u30ed\u30c3\u30af\u3092\u4e0e\u3048\u308b\u3002<\/li>\n<li>Tout : SCL==H\u306e\u671f\u9593\u304cTout (2msec) \u4ee5\u4e0a\u306e\u5834\u5408\u3001TTP229\u306f\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u3084\u3081\u3066\u30b9\u30bf\u30f3\u30d0\u30a4(\u30ad\u30fc\u30bf\u30c3\u30c1\u5f85\u3061)\u72b6\u614b\u306b\u623b\u308b\u3068\u306e\u3053\u3068\u3002<\/li>\n<li>SDO\u306b\u306f \u30bf\u30c3\u30c1\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u304c&#8221;0&#8243;\u3068\u306a\u3063\u305f8\u30d3\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u304c\u30ad\u30fc1(LSB)\u304b\u3089\u9806\u306b\u51fa\u529b\u3055\u308c\u308b(\u51fa\u8377\u72b6\u614b\u306e\u3001\u30a2\u30af\u30c6\u30a3\u30d6L\u3001\u30b7\u30f3\u30b0\u30eb\u30ad\u30fc\u30018\u30ad\u30fc\u51fa\u529b\u69cb\u6210\u6642)\u3002\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u898b\u3066\u3082\u3001\u5404\u30ad\u30fc\u306e\u30c7\u30fc\u30bf\u304c\u78ba\u5b9a\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u660e\u78ba\u306b\u306f\u8aad\u307f\u53d6\u308c\u306a\u3044\u306e\u3060\u3051\u3069\u3001\u4e0a\u56f3\u306e\u3088\u3046\u306bSCL\u306e\u7acb\u4e0a\u308a\u3067\u8aad\u3081\u3070\u826f\u3055\u305d\u3046\u3067\u3042\u308b\u3002<\/li>\n<li>\u4e0a\u56f3\u306f\u30011\u3068\u66f8\u3044\u3066\u3042\u308b\u30ad\u30fc\u3092\u62bc\u3057\u305f\u5834\u5408\u306e\u6ce2\u5f62\u306e\u6982\u7565\u3092\u793a\u3057\u3066\u3044\u308b\u304c\u3001LSB\u304b\u3089\u4f55\u756a\u76ee\u306e\u30d3\u30c3\u30c8\u304c0\u304b\u306b\u3088\u3063\u3066\u62bc\u4e0b\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u304c\u308f\u304b\u308b\u3002\u30d3\u30c3\u30c80\u304c0\u306a\u3089\u3070\u30ad\u30fc1\uff0c\u30d3\u30c3\u30c87\u304c0\u306a\u3089\u3070\u30ad\u30fc8\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u3002<\/li>\n<\/ul>\n<h3>\u30bf\u30c3\u30c1\u3055\u308c\u305f\u30ad\u30fc\u3092\u78ba\u8a8d\u3059\u308b\u30b9\u30b1\u30c3\u30c1<\/h3>\n<pre class=\"lang:default decode:true \">#define LED 13\r\n#define TTP_SDO 2\r\n#define TTP_SCL 4\r\n\r\n#define READ_SDO()  (PIND &amp; B00000100)\r\n#define SET_SCL() (PORTD |= B00010000)\r\n#define RESET_SCL() (PORTD &amp;= B11101111)\r\n\r\nvoid setup() {\r\n  delay(500); \r\n  Serial.begin(115200);\r\n  Serial.println(\"start\");\r\n\r\n  pinMode(LED, OUTPUT);\r\n  pinMode(TTP_SDO, INPUT);\r\n  pinMode(TTP_SCL, OUTPUT);\r\n  SET_SCL();      \/\/ default H\r\n}\r\n\r\nbool read_keydata() {\r\n  RESET_SCL();\r\n  delayMicroseconds(5);\r\n  SET_SCL();\r\n  int n = READ_SDO();\r\n  delayMicroseconds(5);\r\n  return n != 0;\r\n}\r\n\r\nvoid loop() {\r\n  int n = READ_SDO();\r\n  if (n == 0) { \r\n    delayMicroseconds(100);\r\n    int i;\r\n    unsigned int tpp_data = 0;\r\n    int key_no = 0;\r\n    for(i = 0; i &lt; 8; i++) {\r\n      tpp_data &gt;&gt;= 1;\r\n      bool f = read_keydata();\r\n      tpp_data |= f ? 0x80 : 0;\r\n      if (!f)\r\n        key_no = i + 1;\r\n    }\r\n    tpp_data |= 0xff00;\r\n\/\/  if (tpp_data != 0xffff) {\r\n      Serial.print(tpp_data, 16);\r\n      Serial.print(\" : \");\r\n      Serial.println(key_no);\r\n\/\/  }\r\n    delay(2); \/\/ keep SCL==H for 2msec.\r\n  }\r\n}\r\n<\/pre>\n<p>\u540c\u671f\u30af\u30ed\u30c3\u30af\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001I\/O\u30d4\u30f3\u306e\u4e0a\u3052\u4e0b\u3052\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3092\u6e1b\u3089\u3059\u305f\u3081\u3001digitalRead(), digitalWrite() \u306e\u4ee3\u308f\u308a\u306b PORTD\u306e\u30ec\u30b8\u30b9\u30bf\u306b\u76f4\u63a5\u4f5c\u7528\u3059\u308b\u305f\u3081\u306e\u30de\u30af\u30ed\u3092\u7528\u610f\u3057\u305f\u3002<\/p>\n<h6>void setup()<\/h6>\n<p>TPP229B\u306f\u3001\u96fb\u6e90\u6295\u5165\u6642\u306e\u521d\u671f\u5316\u3084\u5b89\u5b9a\u5316\u306e\u305f\u3081\u306b0.5\u79d2\u9593\u5fc5\u8981\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067delay(500)\u3057\u3066\u3044\u308b\u3002\u305d\u3057\u3066I\/O\u30dd\u30fc\u30c8\u306e\u52d5\u4f5c\u30e2\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u3001SCL==H\u3068\u3057\u3066\u3044\u308b\u3002<\/p>\n<h6>void loop()<\/h6>\n<p>READ_SDO()\u306b\u3088\u308a\u3001\u30dd\u30fc\u30c8D2\u304c&#8221;L&#8221;\u306b\u306a\u3063\u305f\u3089Tw(10\u03bcsec)\u5206\u306e\u9045\u5ef6\u306e\u3042\u3068\u304b\u3089\u3001read_keydata() \u30928\u56de\u547c\u3073\u51fa\u3059\u3053\u3068\u30678\u30d3\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u3092\u5f97\u3066\u3044\u308b\u3002\u5909\u6570tpp_data\u306b\u306f\u53d7\u4fe1\u3057\u305f8\u30d3\u30c3\u30c8\u30c7\u30fc\u30bf\u3092\u3001key_no\u306b\u306f\u62bc\u4e0b\u3055\u308c\u305f\u30ad\u30fc\u756a\u53f7\u304c\u683c\u7d0d\u3057\u3001\u305d\u308c\u3089\u3092\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u306b\u51fa\u529b\u3059\u308b\u3002<\/p>\n<p>\u30ad\u30fc\u304b\u3089\u6307\u3092\u96e2\u3057\u305f\u3068\u304d\u306b\u306f0xff\u3092\u53d7\u4fe1\u3059\u308b\u3002\u3053\u308c\u306f\u5168\u30ad\u30fc\u30aa\u30d5\u3092\u8868\u3057\u3066\u3044\u308b\u306e\u3060\u308d\u3046\u3002\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u306b\u51fa\u529b\u3059\u308b\u90e8\u5206\u3092\u3001<span class=\"lang:default decode:true crayon-inline\">\/\/ if (tpp_data != 0xffff) {<\/span>\u00a0\u3068\u3044\u3046\u30b3\u30e1\u30f3\u30c8\u306b\u3057\u305fif\u30d6\u30ed\u30c3\u30af\u3067\u56f2\u3093\u3067\u3044\u308b\u304c\u3001\u30ad\u30fc\u3092\u96e2\u3057\u305f\u5834\u5408\u3092\u7121\u8996\u3059\u308b\u306a\u3089\u3070\u3001&#8221;\/\/&#8221; \u3092\u5916\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30ad\u30fc\u306e\u4e0a\u306b\u305a\u3063\u3068\u6307\u3092\u7f6e\u3044\u3066\u3044\u3066\u3082\u30ad\u30fc\u30fb\u30ea\u30d4\u30fc\u30c8\u306f\u767a\u751f\u3057\u306a\u3044\u3057\u3001\u8907\u6570\u306e\u30ad\u30fc\u306b\u6307\u3092\u7f6e\u3044\u305f\u5834\u5408\u30822\u3064\u76ee\u4ee5\u964d\u306e\u30bf\u30c3\u30c1\u306f\u7121\u8996\u3055\u308c\u308b\u3002<\/p>\n<h6>bool\u00a0read_keydata()<\/h6>\n<p>SCL\u3092\u4e0b\u3052\u4e0a\u3052\u3057\u3001SDO\u306e\u5185\u5bb9\u30921\u30d3\u30c3\u30c8\u8aad\u3080\u3002<\/p>\n<p>SCL\u306f\u521d\u671f\u5316\u6642\u304b\u3089H\u306a\u306e\u3067\u3001\u3053\u306e\u95a2\u6570\u3067L\u3068\u3057\u30665\u03bcsec\u5f85\u3063\u3066\u304b\u3089H\u3068\u3057\u3066\u307e\u305f5\u03bcsec\u5f85\u3064\u3002\u306a\u306e\u3067\u3001F_SCL = 100KHz\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u3002SCL\u3092H\u3068\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067SDO(D2)\u306e\u5024\u3092\u8aad\u307f\u53d6\u3063\u3066\u3044\u308b\u3002\u95a2\u6570\u306f\u3001\u8aad\u307f\u53d6\u3063\u305f\u30d3\u30c3\u30c8\u304cH\u30ec\u30d9\u30eb\u306a\u3089\u3070true\u3092\u8fd4\u3059\u3002<\/p>\n<h3>\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u51fa\u529b<\/h3>\n<p>\u306a\u3093\u306e\u82b8\u3082\u306a\u3044\u306e\u3060\u304c\u3001\u30ad\u30fc1\u304b\u3089\u30ad\u30fc8\u307e\u3067\u3092\u9806\u306b\u30bf\u30c3\u30c1\u3057\u3066\u96e2\u3059\u3092\u7e70\u308a\u8fd4\u3057\u305f\u5834\u5408\u3001\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<figure id=\"attachment_6169\" aria-describedby=\"caption-attachment-6169\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-6169\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2017\/08\/0d40a5e4a645fc6b96e767d64ac0878e-1-552x455.png\" alt=\"\" width=\"552\" height=\"455\" \/><\/a><figcaption id=\"caption-attachment-6169\" class=\"wp-caption-text\">\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u51fa\u529b (8\u30ad\u30fc)<\/figcaption><\/figure>\n<p>tpp_data == 0xfffe\u306a\u3089\u3070\u30d3\u30c3\u30c80\u304c0\u3067\u30ad\u30fc1\u304c\u30aa\u30f3\u30010xff7f\u306a\u3089\u3070\u30d3\u30c3\u30c87\u304c0\u3067\u30ad\u30fc8\u304c\u30aa\u30f3\u3068\u3044\u3046\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u4f55\u304b\u8868\u793a\u30c7\u30d0\u30a4\u30b9\u3067\u3082\u3042\u308c\u3070\u3001\u52d5\u753b\u306b\u3067\u304d\u3066\u30b5\u30de\u306b\u306a\u308b\u306e\u3060\u304c\u3002<\/p>\n<h2>\u304d\u3087\u3046\u306e\u307e\u3068\u3081<\/h2>\n<p>\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5229\u7528\u306f\u5b9f\u306b\u7c21\u5358\u3002\u6d88\u8cbb\u96fb\u529b\u3082\u5c11\u306a\u3044\u3002\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u5de5\u4f5c\u7528\u306b\u306f\u30d4\u30f3\u30d8\u30c3\u30c0\u304c\u4e0b\u5411\u304d\u306b\u3064\u3051\u3066\u304f\u308c\u308b\u304b\u3001\u30d1\u30bf\u30fc\u30f3\u3060\u3051\u3067\u30d4\u30f3\u30d8\u30c3\u30c0\u7121\u3057\u306e\u65b9\u304c\u3088\u304b\u3063\u305f\u3002\u4f55\u304b\u5f79\u306b\u7acb\u3064\u3082\u306e\u306b\u4f7f\u304a\u3046\u3068\u601d\u3063\u305f\u3089\u3001\u30d4\u30f3\u30d8\u30c3\u30c0\u306f\u81ea\u5206\u3067\u5916\u3059\u3053\u3068\u306b\u306a\u308b\u3060\u308d\u3046\u3002<\/p>\n<p>\u30b8\u30e3\u30f3\u30d1\u30a8\u30ea\u30a2\u306b\u30d8\u30c3\u30c0\u3092\u7acb\u3066\u3066\u3001\u7c21\u5358\u306b\u8a2d\u5b9a\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u3057\u3066\u304b\u3089\u4ed6\u306e\u6a5f\u80fd\u3082\u8a66\u3057\u3066\u307f\u308b\u4e88\u5b9a\u3002<\/p>\n<h4>\u8ffd\u8a18<\/h4>\n<p>\u898b\u76f4\u3057\u3066\u307f\u308b\u3068\u3001TTP229 \u3092 TPP299\u3068\u66f8\u3044\u3066\u3044\u308b\u3068\u3053\u308d\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u4fee\u6b63\u3057\u305f\u3002\u30b9\u30b1\u30c3\u30c1\u5185\u306e\u5909\u6570\u540d\u306f\u5909\u66f4\u305b\u305a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>amazon\u3067\u96fb\u5b50\u90e8\u54c1\u3092\u3042\u3055\u3063\u3066\u3044\u308b\u3068\u304d\u300116\u30ad\u30fc\u69cb\u6210\u306e\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30ad\u30fc\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u76ee\u306b\u3064\u3044\u305f\u306e\u3067\u3064\u3044\u3067\u306b\u8cfc\u5165 (199\u5186)\u3002\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u306e\u64cd\u4f5c\u90e8\u306b\u3044\u3044\u304b\u306a\u3068\u601d\u3063\u3066\u3001\u3055\u3063\u305d\u304f5V\u52d5\u4f5c\u306eArduino PRO MINI &hellip; <a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=6130\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u9759\u96fb\u5bb9\u91cf\u30bf\u30c3\u30c1\u30ad\u30fc\u3092Arduino PRO MINI\u306b\u63a5\u7d9a<\/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],"class_list":["post-6130","post","type-post","status-publish","format-standard","hentry","category-programming","tag-arduino"],"_links":{"self":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6130","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=6130"}],"version-history":[{"count":0,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6130\/revisions"}],"wp:attachment":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}