{"id":3048,"date":"2018-01-09T11:31:57","date_gmt":"2018-01-09T02:31:57","guid":{"rendered":"http:\/\/www.ois-yokohama.co.jp\/oisblog\/?p=3048"},"modified":"2019-03-01T19:26:14","modified_gmt":"2019-03-01T10:26:14","slug":"mbed-%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9f%e3%83%ad%e3%83%9c%e3%83%83%e3%83%88%e4%bd%9c%e6%88%90%e3%80%80%e7%ac%ac2%e5%9b%9e","status":"publish","type":"post","link":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/archives\/3048","title":{"rendered":"mbed \u3092\u4f7f\u3063\u305f\u30ed\u30dc\u30c3\u30c8\u4f5c\u6210\u3000\u7b2c2\u56de"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"563\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01.jpg\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01.jpg 958w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01-300x225.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01-768x576.jpg 768w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/div>\n<h3>\u3010\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u3066\u307f\u308b\u3011<\/h3>\n<p>&nbsp;<\/p>\n<h4>\u306f\u3058\u3081\u306b<\/h4>\n<p>\u4eba\u304c\u5916\u90e8\u306e\u4f55\u304b\u3092\u611f\u77e5\u3059\u308b\u6642\u3001\u4e94\u611f\u3092\u4f7f\u3046\u3053\u3068\u306f\u3001\u7686\u3055\u3093\u3054\u627f\u77e5\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30dc\u30c3\u30c8(\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf)\u304c\u5916\u90e8\u306e\u4f55\u304b\u3092\u611f\u77e5\u3059\u308b\u5834\u5408\u3001\u4e94\u611f\u306a\u3093\u3066\u3082\u306e\u306f\u7121\u3044\u306e\u3067\u3001\u304a\u81b3\u7acb\u3066\u3092\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c\u3001\u30bb\u30f3\u30b5\u3067\u3059\u3002<br \/>\n\u6700\u8fd1\u3067\u306f\u6025\u901f\u306f\u6280\u8853\u9032\u6b69\u306b\u3088\u308a\u3001\u69d8\u3005\u306a\u30bb\u30f3\u30b5\u304c\u767b\u5834\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u30de\u30a4\u30b3\u30f3\u3067\u52d5\u4f5c\u3059\u308b\u30ed\u30dc\u30c3\u30c8\u306e\u300e<strong>\u76ee<\/strong>\u300f\u3068\u306a\u308b\u30bb\u30f3\u30b5\u30fc\u306b\u3064\u3044\u3066<strong>\u8d64\u5916\u7dda\u30bb\u30f3\u30b5<\/strong>\u3092\u63a1\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u63a1\u7528\u3057\u305f\u7406\u7531\u3068\u3057\u3066\u306f\u3001\u30de\u30a4\u30b3\u30f3\u3067\u52d5\u4f5c\u3059\u308b\u30ed\u30dc\u30c3\u30c8\u3068\u3044\u3046\u6027\u8cea\u4e0a\u3001\u7701\u96fb\u529b\u3001\u7701\u30b9\u30da\u30fc\u30b9\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a \u304b\u3064 \u5236\u5fa1\u3092\u7c21\u5358\u306b\u3057\u305f\u304b\u3063\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n<h4>\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u306b\u3064\u3044\u3066<\/h4>\n<p>\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u306f\u3001\u4eca\u3084\u3069\u3053\u306b\u3067\u3082\u8a2d\u7f6e\u3055\u308c\u3066\u304a\u308a\u3001\u8ab0\u3082\u304c\u6c17\u4ed8\u304f\u3053\u3068\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee3\u8868\u7684\u306f\u5b9f\u88c5\u4e8b\u4f8b\u3068\u3057\u3066\u306f\u3001\u30b3\u30f3\u30d3\u30cb\u306e<strong>\u81ea\u52d5\u30c9\u30a2<\/strong>\u3001<strong>\u9632\u72af\u7528\u4eba\u611f\u30bb\u30f3\u30b5<\/strong>\u306a\u3069\u304c\u3042\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u4ed5\u7d44\u307f\u306f\u3044\u305f\u3063\u3066\u5358\u7d14\u3067\u3001\u767a\u5149\u7d20\u5b50\u304b\u3089\u8d64\u5916\u7dda(\u5149)\u3092\u7167\u5c04\u3057\u3001\u305d\u306e\u53cd\u5c04\u5149\u3092\u53d7\u5149\u7d20\u5b50\u306b\u3088\u308a\u53d7\u5149\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u30c7\u30fc\u30bf\u5316\u3057\u307e\u3059\u3002<br \/>\n\u3082\u3063\u3068\u8a73\u7d30\u304c\u77e5\u308a\u305f\u3044\u65b9\u306f\u3001\u300e\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u300f\u3067\u30b0\u30b0\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4eca\u56de\u3001\u4f7f\u7528\u3059\u308b\u30bb\u30f3\u30b5\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002<\/p>\n<table border=\"1\" width=\"100%\">\n<tbody>\n<tr>\n<td>\u88fd\u54c1\u540d<\/td>\n<td>\u8ddd\u96e2\u8a08\u6e2c\u30e2\u30b8\u30e5\u30fc\u30eb(\u30cf\u30fc\u30cd\u30b9\u4ed8\u304d)<\/td>\n<\/tr>\n<tr>\n<td>\u30e1\u30fc\u30ab\u30fc<\/td>\n<td>\u30b7\u30e3\u30fc\u30d7<\/td>\n<\/tr>\n<tr>\n<td>\u578b\u756a<\/td>\n<td>GP2Y0A21K0F<\/td>\n<\/tr>\n<tr>\n<td>\u8ddd\u96e2\u8a08\u6e2c\u7bc4\u56f2<\/td>\n<td>10\uff5e80cm<\/td>\n<\/tr>\n<tr>\n<td>\u51fa\u529b<\/td>\n<td>\u30a2\u30ca\u30ed\u30b0\u96fb\u5727\u51fa\u529b<\/td>\n<\/tr>\n<tr>\n<td>\u5024\u6bb5<\/td>\n<td>600\u5186(\u697d\u5929\u5e02\u5834\u3067\u30dd\u30c1\u3063\u3068\u3057\u307e\u3057\u305f)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8ddd\u96e2\u8a08\u6e2c\u30e2\u30b8\u30e5\u30fc\u30ebGP2Y0A21K0F\u306f\u8d64\u5916\u7ddaLED\u3068\u5149\u4f4d\u7f6e\u30bb\u30f3\u30b5PDS(Position Sensitive Detector)\u3001\u4fe1\u53f7\u51e6\u7406\u56de\u8def\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u8d64\u5916\u7ddaLED\u304b\u3089\u7167\u5c04\u3057\u305f\u8d64\u5916\u7dda\u304c\u7269\u306b\u53cd\u5c04\u3055\u308c\u3001\u305d\u306e\u53cd\u5c04\u5149\u3092\u5149\u4f4d\u7f6e\u30bb\u30f3\u30b5PDS\u3067\u53d7\u4fe1\u3057\u3066\u3001\u51fa\u529b\u96fb\u5727\u3092\u8ddd\u96e2\u306b\u5fdc\u3058\u3066\u5909\u5316\u3055\u305b\u3066\u51fa\u529b\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u8ddd\u96e2L\uff0d\u51fa\u529b\u96fb\u5727V\u7279\u6027\u306f\u3001\u7269\u3068\u306e\u8ddd\u96e2L\u304c\u5c0f\u3055\u304f(\u8fd1\u3065\u304f)\u306b\u3064\u3044\u308c\u3066\u51fa\u529b\u96fb\u5727\uff36\u5927\u304d\u304f\u306a\u308a\u3001\u8ddd\u96e2\uff2c\u304c\u5927\u304d\u304f(\u96e2\u308c\u308b\uff09\u306b\u3064\u308c\u3066\u51fa\u529b\u96fb\u5727\uff36\u306f\u5c0f\u3055\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u51fa\u529b\u96fb\u5727\uff36\u3092mbed\u306e\u30a2\u30ca\u30ed\u30b0\u5165\u529b\u3068\u3057\u3001A-D\u30b3\u30f3\u30d0\u30fc\u30bf\u3067\u30c7\u30b8\u30bf\u30eb\u5024\u306b\u5909\u63db\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3062 size-full\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01.jpg\" alt=\"mbed01\" width=\"958\" height=\"719\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01.jpg 958w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01-300x225.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed01-768x576.jpg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><br \/>\nmbed\u3068\u306e\u63a5\u7d9a\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3060 size-full\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed02.png\" alt=\"mbed02\" width=\"429\" height=\"125\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed02.png 429w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/mbed02-300x87.png 300w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><br \/>\n\u203bGP2Y0A21K0F\u5074\u306e\u8272\u306f\u30cf\u30fc\u30cd\u30b9\u306e\u8272\u3067\u3059\u3002\u9ed2\u304cGND\u3067\u306a\u3044\u306e\u304c\u30dd\u30a4\u30f3\u30c8\u3002<\/p>\n<h4>\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u3064\u3044\u3066<\/h4>\n<p>\u958b\u767a\u74b0\u5883\u306f\u3001\u300c<a href=\"www.ois-yokohama.co.jp\/oisblog\/archives\/2505\" target=\"_blank\" rel=\"noopener\">mbed\u3092\u4f7f\u3063\u305f\u30ed\u30dc\u30c3\u30c8\u4f5c\u6210 \u7b2c1\u56de<\/a>\u300d\u3067\u3054\u7d39\u4ecb\u3057\u305f\u300cARM\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30b3\u30f3\u30d1\u30a4\u30eb\u74b0\u5883\u300d\u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u30e1\u30a4\u30f3\u51e6\u7406\u3067\u7121\u9650\u30eb\u30fc\u30d7\u3057\u3001\u30a2\u30ca\u30ed\u30b0\u30dd\u30fc\u30c8\u304b\u3089\u5165\u529b\u306e\u3042\u3063\u305f\u5024\u306b\u5fdc\u3058\u3066\u3001LED\u306e\u70b9\u6ec5\u6642\u9593\u3092\u5909\u66f4\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3057\u3066\u691c\u8a3c\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"nums:false lang:default decode:true \">#include \"mbed.h\"\r\nDigitalOut myled(LED2); \/* \u70b9\u6ec5\u3059\u308bLED\u30dd\u30fc\u30c8\u306e\u5b9a\u7fa9 *\/\r\nAnalogIn ain(A0);       \/* \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u30dd\u30fc\u30c8\u306e\u5b9a\u7fa9 *\/\r\n\/*\r\n* \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u306b\u5fdc\u3058\u3066LED\u306e\u70b9\u6ec5\u6642\u9593\u3092\u5909\u66f4\u3059\u308b\r\n *\/\r\nint main() {\r\n    double time = 1.0;\r\nwhile(1) {\r\n    \/* ain \u306e\u5024 \u5fdc\u3058\u3066 Wait \u6642\u9593\u3092\u6c7a\u5b9a\u3059\u308b *\/\r\n        \/* \u8ddd\u96e2\u304c\u8fd1\u3044\u7a0b\u3001ain \u306e\u5024\u306f\u5927\u304d\u304f\u306a\u308b  *\/\r\n        if ( ain &amp;amp;gt; 0.8f ){\r\n            time = 0.2; \/* 0.2 sec *\/\r\n        } else if( ain &amp;amp;gt; 0.6f ){\r\n            time = 0.5; \/* 0.5 sec *\/\r\n        } else if( ain &amp;amp;gt; 0.4f ){\r\n            time = 1.0; \/* 1.0 sec *\/\r\n        } else if( ain &amp;amp;gt; 0.2f ){\r\n            time = 1.5; \/* 1.5 sec *\/\r\n        } else {\r\n            time = 2.0; \/* 2.0 sec *\/\r\n        }\r\n        myled = 1;  \/* LED is ON *\/\r\n        wait(time); \/* ON Wait *\/\r\n        myled = 0;  \/* LED is OFF *\/\r\n        wait(time); \/* OFF Wait *\/\r\n    }\r\n}\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<div style=\"width: 568px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3048-1\" width=\"568\" height=\"320\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u5b9f\u9a13\u7d50\u679c.mp4?_=1\" \/><a href=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u5b9f\u9a13\u7d50\u679c.mp4\">https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2018\/01\/\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u5b9f\u9a13\u7d50\u679c.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>\u969c\u5bb3\u7269\u304c\u300c<strong>\u96e2\u308c\u3066\u3044\u308b\u3068LED\u306e\u70b9\u6ec5\u304c\u9045\u304f<\/strong>\u300d\u3001\u300c<strong>\u8fd1\u3065\u304f\u3068LED\u306e\u70b9\u6ec5\u304c\u65e9\u304f\u306a\u308b<\/strong>\u300d\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u7c21\u5358\u306a\u30dd\u30fc\u30c8\u5236\u5fa1\u3092\u3059\u308b\u3060\u3051\u3067\u3001\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u305f\u8ddd\u96e2\u8a08\u6e2c\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u7d50\u679c\u3092\u3082\u3068\u306b\u3001\u30ed\u30dc\u30c3\u30c8\u306b\u969c\u5bb3\u7269\u56de\u907f\u3092\u3055\u305b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b21\u56de\u306f\u3001\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u5236\u5fa1\u304bLCD\u8868\u793a\u3042\u305f\u308a\u3092\u3084\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\n#mbed , #NUCLEO-F401RE , #GP2Y0A21K<\/p>\n<p>\u3010\u53c2\u8003\u3011<br \/>\n<a style=\"color: #0066cc;\" href=\"www.ois-yokohama.co.jp\/oisblog\/archives\/2505\" target=\"_blank\" rel=\"noopener\">mbed\u3092\u4f7f\u3063\u305f\u30ed\u30dc\u30c3\u30c8\u4f5c\u6210\u3000\u7b2c1\u56de<\/a><br \/>\n<a href=\"http:\/\/www.ois-yokohama.co.jp\/oisblog\/archives\/3578\" target=\"_blank\" rel=\"noopener\">mbed\u3092\u4f7f\u3063\u305f\u30ed\u30dc\u30c3\u30c8\u4f5c\u6210\u3000\u7b2c3\u56de<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u8d64\u5916\u7dda\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u3066\u307f\u308b\u3011 &nbsp; \u306f\u3058\u3081\u306b \u4eba\u304c\u5916\u90e8\u306e\u4f55\u304b\u3092\u611f\u77e5\u3059\u308b\u6642\u3001\u4e94\u611f\u3092\u4f7f\u3046\u3053\u3068\u306f\u3001\u7686\u3055\u3093\u3054\u627f\u77e5\u306e\u3068\u304a\u308a\u3067\u3059\u3002 \u30ed\u30dc\u30c3\u30c8(\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf)\u304c\u5916\u90e8\u306e\u4f55\u304b\u3092\u611f\u77e5\u3059\u308b\u5834\u5408\u3001\u4e94\u611f\u306a\u3093\u3066\u3082\u306e\u306f\u7121\u3044\u306e\u3067\u3001\u304a\u81b3\u7acb\u3066\u3092\u3057\u3066 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3062,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"vkexunit_cta_each_option":"","footnotes":""},"categories":[106,13,6],"tags":[334,335,336,337,338,339,340],"class_list":["post-3048","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-106","category-13","category-engineer","tag-334","tag-335","tag-336","tag-337","tag-338","tag-339","tag-340"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/3048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/comments?post=3048"}],"version-history":[{"count":3,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/3048\/revisions"}],"predecessor-version":[{"id":5929,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/3048\/revisions\/5929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media\/3062"}],"wp:attachment":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media?parent=3048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/categories?post=3048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/tags?post=3048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}