{"id":3186,"date":"2014-09-09T00:09:24","date_gmt":"2014-09-08T15:09:24","guid":{"rendered":"http:\/\/www.syuheiuda.com\/?p=3186"},"modified":"2014-09-09T00:09:24","modified_gmt":"2014-09-08T15:09:24","slug":"windows-for-iot-%e3%81%a7%e8%b7%9d%e9%9b%a2%e3%82%92%e6%b8%ac%e3%82%8b-gp2y0a21yk","status":"publish","type":"post","link":"https:\/\/www.syuheiuda.com\/?p=3186","title":{"rendered":"Windows for IoT \u3067\u8ddd\u96e2\u3092\u6e2c\u308b (GP2Y0A21YK)"},"content":{"rendered":"<p>\u79cb\u6708\u3067\u624b\u306b\u5165\u308b\u8ddd\u96e2\u30bb\u30f3\u30b5\u30fc (SHARP <a href=\"http:\/\/akizukidenshi.com\/catalog\/g\/gI-02551\/\">GP2Y0A21YK<\/a>) \u3092\u4f7f\u3063\u3066\u8ddd\u96e2\u3092\u6e2c\u308a\u307e\u3059\u3002<\/p>\n<p>[\u53c2\u8003]<\/p>\n<p><a title=\"http:\/\/yutapon.hatenablog.com\/entry\/2014\/02\/09\/192603\" href=\"http:\/\/yutapon.hatenablog.com\/entry\/2014\/02\/09\/192603\">http:\/\/yutapon.hatenablog.com\/entry\/2014\/02\/09\/192603<\/a><\/p>\n<p><a title=\"http:\/\/www.pwv.co.jp\/~take\/TakeWiki\/index.php?Arduino%2FArduino%E3%81%AE%E5%8B%89%E5%BC%B7%E3%81%AF%E3%81%98%E3%82%81%E3%81%BE%E3%81%97%E3%81%9F#ab78b6e7\" href=\"http:\/\/www.pwv.co.jp\/~take\/TakeWiki\/index.php?Arduino%2FArduino%E3%81%AE%E5%8B%89%E5%BC%B7%E3%81%AF%E3%81%98%E3%82%81%E3%81%BE%E3%81%97%E3%81%9F#ab78b6e7\">http:\/\/www.pwv.co.jp\/~take\/TakeWiki\/index.php?Arduino%2FArduino%E3%81%AE%E5%8B%89%E5%BC%B7%E3%81%AF%E3%81%98%E3%82%81%E3%81%BE%E3%81%97%E3%81%9F#ab78b6e7<\/a><\/p>\n<p><\/p>\n<p>\u6c17\u3092\u4ed8\u3051\u308b\u306e\u306f\u3001analogRead \u306e\u5024\u304c 4096 \u6bb5\u968e\u306a\u3068\u3053\u308d\u3002<\/p>\n<p>\u4e0a\u8a18\u30da\u30fc\u30b8\u306e\u3088\u3046\u306a Arduino \u306e\u30b5\u30f3\u30d7\u30eb\u3067\u51fa\u3066\u3044\u308b\u5f0f\u306b\u7a81\u3063\u8fbc\u3080\u5834\u5408\u306f\u3001analogRead \u304c 1024 \u6bb5\u968e\u306a\u306e\u3092\u8003\u616e\u3057\u3066 4 \u3067\u5272\u3063\u3066\u304b\u3089\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u53d6\u3063\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u5927\u4f53\u3042\u3063\u3066\u308b\u6c17\u304c\u3059\u308b\u3002<br \/>\u305f\u307e\u306b\u5916\u308c\u5024\u3068\u3044\u3046\u304b\u3001\u30c7\u30ab\u3059\u304e\u308b\u5024\u304c\u5e30\u3063\u3066\u304f\u308b\u306e\u3067\u3001\u9069\u5b9c\u4e38\u3081\u305f\u308a\u306f\u5fc5\u8981\u304b\u3082\u3002<\/p>\n<\/p>\n<p>\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3068\u304b\u3092\u898b\u308b\u3068\u3001\u3053\u308c\u306e\u6e2c\u5b9a\u7bc4\u56f2\u306f 10 \u2013 80 cm \u3060\u305d\u3046\u306a\u306e\u3067\u3001\u305d\u308c\u4ee5\u5916\u306f\u4e38\u3081\u308c\u3070\u304a\uff4b\u304b\u306a\uff1f<\/p>\n<p><a href=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/image.png\"><img decoding=\"async\" loading=\"lazy\" width=\"244\" height=\"213\" title=\"image\" style=\"border: 0px currentcolor; border-image: none; display: inline;\" alt=\"image\" src=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/image_thumb.png\" border=\"0\"><\/a> <\/p>\n<p><\/p>\n<p><a href=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/distance.png\"><img decoding=\"async\" loading=\"lazy\" width=\"516\" height=\"480\" title=\"distance\" style=\"border: 0px currentcolor; border-image: none; display: inline;\" alt=\"distance\" src=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/distance_thumb.png\" border=\"0\"><\/a>\n<\/p>\n<p><\/p>\n<pre><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n\/\/ Main.cpp : Defines the entry point for the console application.\n\/\/\n\n#include &quot;stdafx.h&quot;\n#include &quot;arduino.h&quot;\n\nint _tmain(int argc, _TCHAR* argv&#x5B;])\n{\n    return RunArduinoSketch();\n}\n\nint tmp;\nint distance;\n\nvoid setup()\n{\n\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop()\n{\n\ttmp = analogRead(0)\/4;\n\n\tif (tmp &amp;lt; 4) tmp = 4;\n\n\t\/\/ \u8ddd\u96e2\u3092\u8a08\u7b97\uff08cm\uff09\n\tdistance = (6787 \/ (tmp - 3)) - 4;\n\tLog(L&quot;distance : %dn&quot;, distance);\n\tdelay(100);\n}\n&lt;\/pre&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u79cb\u6708\u3067\u624b\u306b\u5165\u308b\u8ddd\u96e2\u30bb\u30f3\u30b5\u30fc (SHARP GP2Y0A21YK) \u3092\u4f7f\u3063\u3066\u8ddd\u96e2\u3092&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.syuheiuda.com\/?p=3186\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_locale":"","_original_post":""},"categories":[2,4,8,18],"tags":[],"views":5514,"_links":{"self":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3186"}],"collection":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3186"}],"version-history":[{"count":0,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3186\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}