{"id":891,"date":"2020-02-23T15:12:24","date_gmt":"2020-02-23T06:12:24","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=891"},"modified":"2020-02-23T15:12:24","modified_gmt":"2020-02-23T06:12:24","slug":"%e3%82%b9%e3%82%a4%e3%83%83%e3%83%81%e3%82%92%e6%8a%bc%e3%81%99","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2020\/02\/23\/891\/","title":{"rendered":"\u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u3059"},"content":{"rendered":"<h1>\u30b9\u30a4\u30c3\u30c1<\/h1>\n<p>\u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u3059\u3068\u30ab\u30a6\u30f3\u30c8\u304c\u5897\u3048\u308b\u3084\u3064\u3002<\/p>\n<h2>\u3068\u308a\u3042\u3048\u305a\u3084\u308b<\/h2>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2020\/02\/sw01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-892\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2020\/02\/sw01-225x300.png\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2020\/02\/sw01-225x300.png 225w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2020\/02\/sw01.png 750w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3064\u306a\u304e<\/p>\n<pre><code class=\"cpp\">int count = 0;\r\n\r\nvoid setup() {\r\n  pinMode(9, INPUT_PULLUP);\r\n  Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n\r\n  if (digitalRead(9) == LOW) {\r\n    count++;\r\n    Serial.print(count);\r\n    Serial.println();\r\n  }\r\n}<\/code><\/pre>\n<p>\u3053\u3093\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u00a0\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u30dd\u30c1\u30c3\u3068\u62bc\u3059\u3068<\/p>\n<pre><code class=\"shell\">12:09:51.333 -&gt; 1\r\n12:09:51.333 -&gt; 2\r\n12:09:51.333 -&gt; 3\r\n\uff5e\u7565\uff5e\r\n12:09:51.437 -&gt; 757\r\n12:09:51.437 -&gt; 758\r\n12:09:51.437 -&gt; 759<\/code><\/pre>\n<p>\u5024\u304c\u3059\u3063\u98db\u3076\u3002\u30b9\u30a4\u30c3\u30c1\u3092\u96e2\u3059\u307e\u3067\u306b\u3001\u6b21\u306eloop\u304c\u6765\u3066\u3057\u307e\u3046\u304b\u3089\u3053\u3046\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u307f\u305f\u3044\u3002(cf.<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%83%81%E3%83%A3%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0\">\u30c1\u30e3\u30bf\u30ea\u30f3\u30b0<\/a>)\u3002\u3088\u308d\u3057\u304f\u306a\u3044\u306e\u3067\u9069\u5f53\u306b\u9045\u5ef6\u3092\u5165\u308c\u308b\u3002<\/p>\n<h2>\u9045\u5ef6\u5165\u308c\u308b<\/h2>\n<pre><code class=\"cpp\">int count = 0;\r\n\r\nvoid setup() {\r\n  pinMode(9, INPUT_PULLUP);\r\n  Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n\r\n  if (digitalRead(9) == LOW) {\r\n    count++;\r\n    Serial.print(count);\r\n    Serial.println();\r\n    delay(200);\r\n  }\r\n}<\/code><\/pre>\n<p>\u305d\u3046\u3059\u308b\u3068\u307e\u3041<\/p>\n<pre><code class=\"shell\">12:41:46.180 -&gt; 1\r\n12:41:47.033 -&gt; 2\r\n12:41:47.924 -&gt; 3\r\n12:41:48.836 -&gt; 4\r\n12:41:49.723 -&gt; 5<\/code><\/pre>\n<p>\u30dd\u30c1\u30c3\u3050\u3089\u3044\u3060\u3068\u4e0a\u624b\u304f\u3044\u304f\u3002\u3053\u308c\u304c\u30dd\u30fc\u30c3\u30c1\u3068\u304b\uff8e\uff9f\uff81\uff8e\uff9f\uff81\uff8e\uff9f\uff81\u3068\u304b\u3060\u3068\u62bc\u3057\u305f\u56de\u6570\u3068\u30ab\u30a6\u30f3\u30c8\u304c\u4e00\u81f4\u3057\u306a\u3044\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/vf3P6d2HxJw\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u3053\u3093\u306a\u3002\u30dd\u30fc\u30c3\u30c1\u3068\u304b\uff8e\uff9f\uff81\uff8e\uff9f\uff81\uff8e\uff9f\uff81\u3068\u304b\u306b\u3082\u5bfe\u5fdc\u3057\u305f\u3044\u3002<\/p>\n<h2>\u30dc\u30bf\u30f3\u3092\u96e2\u3059\u3068\u30ab\u30a6\u30f3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<pre><code class=\"cpp\">int count = 0;\r\n\r\nvoid setup() {\r\n  pinMode(9, INPUT_PULLUP);\r\n  Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n\r\n  if (digitalRead(9) == LOW) {\r\n    while (digitalRead(9) == LOW) {}\r\n    \r\n    count++;\r\n    \r\n    Serial.print(count);\r\n    Serial.println();\r\n    delay(10);\r\n  }\r\n}<\/code><\/pre>\n<p>\u62bc\u3057\u305f\u3068\u304d\u3067\u306f\u306a\u304f\u3001\u96e2\u3057\u305f\u6642\u306b\u30ab\u30a6\u30f3\u30c8\u3059\u308c\u3070\u3044\u3044\u306e\u3067\u306f\u3068\u8003\u3048\u305f\u3002\u30b3\u30fc\u30c9\u7684\u306b\u5408\u3063\u3066\u308b\u304b\u5fae\u5999\u306a\u3068\u3053\u3060\u3051\u3069\u3053\u3046\u66f8\u3044\u305f\u3002\u4f55\u3082\u3057\u306a\u3044\u30eb\u30fc\u30d7\u3063\u3066\u4f5c\u3063\u3066\u3044\u3044\u306e\u304b\u306a\u3002\u5fae\u5999\u306b\u30c1\u30e3\u30bf\u308b\u306e\u3067delay\u3082\u5165\u308c\u3066\u307f\u3066\u308b\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/Vrn5HnS2CAY\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>\u3044\u3044\u611f\u3058\u3067\u306f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b9\u30a4\u30c3\u30c1 \u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u3059\u3068\u30ab\u30a6\u30f3\u30c8\u304c\u5897\u3048\u308b\u3084\u3064\u3002 \u3068\u308a\u3042\u3048\u305a\u3084\u308b \u3053\u3093\u306a\u611f\u3058\u3067\u3064\u306a\u304e int count = 0; void setup() { pinMode(9, INPUT_PULLUP); Serial.begi &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2020\/02\/23\/891\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":892,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[69,87,54],"class_list":["post-891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-8","tag-arduino","tag-87","tag-54"],"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":1,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/891\/revisions\/893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media\/892"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}