1"use strict";(self.webpackChunkcubic_9_com=self.webpackChunkcubic_9_com||[]).push([[5626],{28453:(e,n,i)=>{i.d(n,{R:()=>d,x:()=>t});var r=i(96540);const s={},l=r.createContext(s);function d(e){const n=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),r.createElement(l.Provider,{value:n},e.children)}},56623:(e,n,i)=>{i.d(n,{A:()=>r});const r=i.p+"assets/images/ultrasonic2-b7e6931e0811e8da215f7995f947d771.jpg"},73632:(e,n,i)=>{i.d(n,{A:()=>r});const r=i.p+"assets/images/ultrasonic1-505f68beee75434e975d0a3a21c93b4e.jpg"},80240:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>t,default:()=>u,frontMatter:()=>d,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino/\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5","title":"\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5","description":"Maker Faire Tokyo 2013\u306eFabxFab\u69d8\u306e\u30d6\u30fc\u30b9\u3067\u8cfc\u5165\u3057\u305f\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002","source":"@site/docs/Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino/\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5.md","sourceDirName":"Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino","slug":"/Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino/\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5","permalink":"/Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino/\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"\u697d\u5668","permalink":"/Devel/\u96fb\u5b50\u5de5\u4f5c/Arduino/\u697d\u5668"},"next":{"title":"ESP32","permalink":"/Devel/\u96fb\u5b50\u5de5\u4f5c/ESP32/"}}');var s=i(74848),l=i(28453);const d={},t=void 0,c={},o=[{value:"\u5fc5\u8981\u306a\u3082\u306e",id:"\u5fc5\u8981\u306a\u3082\u306e",level:2},{value:"\u624b\u9806",id:"\u624b\u9806",level:2},{value:"\u5099\u8003",id:"\u5099\u8003",level:2},{value:"\u53c2\u8003",id:"\u53c2\u8003",level:2}];function a(e){const n={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{class:"markdown",children:(0,s.jsx)("img",{src:i(80242).A,style:{width:"20%"}})}),"\n",(0,s.jsx)(n.p,{children:"Maker Faire Tokyo 2013\u306eFabxFab\u69d8\u306e\u30d6\u30fc\u30b9\u3067\u8cfc\u5165\u3057\u305f\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002"}),"\n",(0,s.jsx)(n.h2,{id:"\u5fc5\u8981\u306a\u3082\u306e",children:"\u5fc5\u8981\u306a\u3082\u306e"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"\u8d85\u97f3\u6ce2\u8ddd\u96e2\u30bb\u30f3\u30b5\uff08\u4eca\u56de\u306fSDM-IO\uff09"}),"\n"]}),"\n",(0,s.jsxs)("div",{class:"markdown",children:[(0,s.jsx)("img",{src:i(73632).A,style:{width:"20%"}}),(0,s.jsx)("img",{src:i(56623).A,style:{width:"20%"}})]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{href:"http://akizukidenshi.com/catalog/g/gM-05400/",children:"\u79cb\u6708\u3067\u8ca9\u58f2\u3057\u3066\u3044\u308b\u30d1\u30e9\u30e9\u30c3\u30af\u30b9\u793e\u306e\u30bb\u30f3\u30b5"}),"\u3082\u4f3c\u305f\u3088\u3046\u306a\u611f\u3058\u3067\u4f7f\u3048\u308b\u3068\u601d\u3044\u307e\u3059\u3002"]}),"\n",(0,s.jsx)(n.h2,{id:"\u624b\u9806",children:"\u624b\u9806"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"SDM-IO\u306eV5.0\u30d4\u30f3\u3092Arduino\u306e5V\u30d4\u30f3\u306b\u63a5\u7d9a\u3059\u308b\u3002"}),"\n",(0,s.jsx)(n.li,{children:"SDM-IO\u306eGND\u30d4\u30f3\u3092Arduino\u306eGND\u30d4\u30f3\u306b\u63a5\u7d9a\u3059\u308b\u3002"}),"\n",(0,s.jsx)(n.li,{children:"SDM-IO\u306eTRIG\u30d4\u30f3\u3092Arduino\u306e\u30c7\u30b8\u30bf\u30eb8\u30d4\u30f3\u306b\u63a5\u7d9a\u3059\u308b\u3002"}),"\n",(0,s.jsx)(n.li,{children:"\u30b9\u30b1\u30c3\u30c1\u3092\u66f8\u304d\u8fbc\u3080\u3002"}),"\n",(0,s.jsx)(n.li,{children:"\u30b7\u30ea\u30a2\u30eb\u30e2\u30cb\u30bf\u3092\u8868\u793a\u3055\u305b\u3001\u8d85\u97f3\u6ce2\u30bb\u30f3\u30b5\u306e\u524d\u306b\u624b\u3092\u304b\u3056\u3057\u3066\u307f\u308b\u3002"}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"*\u30b9\u30b1\u30c3\u30c1"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-C",children:'#define TRIG_PIN 8 // TRIG\u30d4\u30f3\u306e\u63a5\u7d9a\u5148DIGITAL\u7aef\u5b50\r\n\r\n#define SPEED_OF_SOUND 340.29 // \u97f3\u901f[m/s]\r\n#define INTERVAL 200 // \u6642\u9593\u9593\u9694[ms]\r\n#define ADJUSTMENT 3 // \u8abf\u6574\u5b9a\u6570[cm]\r\n#define TIMEOUT 18000 // \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u6642\u9593[\u03bcs]\r\n#define INIT_PULSE_WIDTH 10 // \u521d\u671f\u5316\u30d1\u30eb\u30b9\u306e\u5e45[\u03bcs]\r\n\r\nunsigned long beginTime;\r\nunsigned long endTime;\r\nunsigned long elapsedTime;\r\nunsigned int echobackPulseWidth;\r\n\r\nfloat distance;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(9600);\r\n pinMode(TRIG_PIN, OUTPUT);\r\n digitalWrite(TRIG_PIN, HIGH);\r\n}\r\n\r\nvoid loop()\r\n{\r\n // \u521d\u671f\u5316\u30d1\u30eb\u30b9\u51fa\u529b\r\n pinMode(TRIG_PIN, OUTPUT);\r\n digitalWrite(TRIG_PIN, HIGH);\r\n delayMicroseconds(2);\r\n digitalWrite(TRIG_PIN, LOW);\r\n delayMicroseconds(INIT_PULSE_WIDTH);\r\n digitalWrite(TRIG_PIN, HIGH);\r\n beginTime = micros(); // \u958b\u59cb\u6642\u523b\u53d6\u5f97\r\n\r\n // \u30a8\u30b3\u30fc\u30d1\u30eb\u30b9\u53d6\u5f97\r\n pinMode(TRIG_PIN, INPUT);\r\n echobackPulseWidth = pulseIn(TRIG_PIN, LOW, TIMEOUT);\r\n\r\n if (echobackPulseWidth == 0) {\r\n Serial.println("distance: -");\r\n } else {\r\n endTime = micros(); // \u7d42\u4e86\u6642\u523b\u53d6\u5f97\r\n elapsedTime = endTime - beginTime - echobackPulseWidth;\r\n \r\n // \u5f80\u5fa9\u306a\u306e\u3067\u30012\u3067\u5272\u308b\r\n distance = elapsedTime * SPEED_OF_SOUND / 10000 / 2 - ADJUSTMENT;\r\n Serial.print("distance: ");\r\n Serial.print(distance);\r\n Serial.println("[cm]");\r\n }\r\n delay(INTERVAL);\r\n}\n'})}),"\n",(0,s.jsx)(n.h2,{id:"\u5099\u8003",children:"\u5099\u8003"}),"\n",(0,s.jsx)(n.p,{children:"\u516c\u5f0f\u306e\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u898b\u3064\u3051\u3089\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4e0b\u8a18\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002"}),"\n",(0,s.jsx)(n.h2,{id:"\u53c2\u8003",children:"\u53c2\u8003"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"http://www.goodluckbuy.com/sdm-io-no-blind-area-ultrasonic-sensor-module-1500mm-range.html",children:"SDM-IO No Blind Area Ultrasonic Sensor Module 1500mm Range $9.84 Free Shipping @GoodLuckBuy.com"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"http://www.crcibernetica.com/ultrasonic-range-finder-sdm-io/",children:"Ultrasonic Range Finder SDM-IO - CRCibern\xe9tica"})}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},80242:(e,n,i)=>{i.d(n,{A:()=>r});const r=i.p+"assets/images/ultrasonic3-9be3c8dea05e698994f8125585f0aea0.jpg"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.