http://m.gharee.com/wiki/index.php?action=history&feed=atom&title=%28SKU%3ARB-02S012%29PING%29%29%29_%E4%B8%A4%E4%B8%AA%E8%B6%85%E5%A3%B0%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E8%81%94%E8%B0%83%E5%AE%9E%E9%AA%8C 123,123 2025-05-14T17:02:05Z 本wiki的該頁面的版本歷史 MediaWiki 1.21.2 http://m.gharee.com/wiki/index.php?title=(SKU:RB-02S012)PING)))_%E4%B8%A4%E4%B8%AA%E8%B6%85%E5%A3%B0%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E8%81%94%E8%B0%83%E5%AE%9E%E9%AA%8C&diff=5238&oldid=prev Arduino77:/* 規(guī)格參數(shù) */ 2016-04-12T08:46:06Z <p>?<span dir="auto"><span class="autocomment">規(guī)格參數(shù)</span></span></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">2016年4月12日 (二) 08:46的版本</td> </tr><tr><td colspan="2" class="diff-lineno">第9行:</td> <td colspan="2" class="diff-lineno">第9行:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#工作溫度范圍:0℃~+70℃</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#工作溫度范圍:0℃~+70℃</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#探測有效距離:2cm~3m</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#探測有效距離:2cm~3m</div></td></tr> <tr><td class='diff-marker'>?</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#尺寸大小: 22 mm H x 46 mm W x 16 mm D <del class="diffchange diffchange-inline">(0.85 in x 1.8 in x 0.6 in)</del></div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#尺寸大?。?22 mm H x 46 mm W x 16 mm D &#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#重量:9g</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>#重量:9g</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==接口定義==</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==接口定義==</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>*GND:電源地</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>*GND:電源地</div></td></tr> </table> Arduino77 http://m.gharee.com/wiki/index.php?title=(SKU:RB-02S012)PING)))_%E4%B8%A4%E4%B8%AA%E8%B6%85%E5%A3%B0%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E8%81%94%E8%B0%83%E5%AE%9E%E9%AA%8C&diff=5236&oldid=prev Arduino77:/* 連接圖示 */ 2016-04-12T08:39:54Z <p>?<span dir="auto"><span class="autocomment">連接圖示</span></span></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">2016年4月12日 (二) 08:39的版本</td> </tr><tr><td colspan="2" class="diff-lineno">第18行:</td> <td colspan="2" class="diff-lineno">第18行:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===連接圖示===</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===連接圖示===</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>兩個超聲波的INPUT引腳接在D5,OUTPUT分別接D3、D4,如下圖:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>兩個超聲波的INPUT引腳接在D5,OUTPUT分別接D3、D4,如下圖:</div></td></tr> <tr><td class='diff-marker'>?</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[文件:<del class="diffchange diffchange-inline">2csb</del>.png|700px|縮略圖|居中]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[文件:<ins class="diffchange diffchange-inline">csb2</ins>.png|700px|縮略圖|居中]]</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===例子程序===</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===例子程序===</div></td></tr> </table> Arduino77 http://m.gharee.com/wiki/index.php?title=(SKU:RB-02S012)PING)))_%E4%B8%A4%E4%B8%AA%E8%B6%85%E5%A3%B0%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E8%81%94%E8%B0%83%E5%AE%9E%E9%AA%8C&diff=5235&oldid=prev Arduino77:/* 連接圖示 */ 2016-04-12T08:39:18Z <p>?<span dir="auto"><span class="autocomment">連接圖示</span></span></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">2016年4月12日 (二) 08:39的版本</td> </tr><tr><td colspan="2" class="diff-lineno">第19行:</td> <td colspan="2" class="diff-lineno">第19行:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>兩個超聲波的INPUT引腳接在D5,OUTPUT分別接D3、D4,如下圖:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>兩個超聲波的INPUT引腳接在D5,OUTPUT分別接D3、D4,如下圖:</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[文件:2csb.png|700px|縮略圖|居中]]</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[文件:2csb.png|700px|縮略圖|居中]]</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===例子程序===</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===例子程序===</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>依照程序連接兩個超聲波傳感器與UNO,測試實際檢測的距離。</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>依照程序連接兩個超聲波傳感器與UNO,測試實際檢測的距離。</div></td></tr> </table> Arduino77 http://m.gharee.com/wiki/index.php?title=(SKU:RB-02S012)PING)))_%E4%B8%A4%E4%B8%AA%E8%B6%85%E5%A3%B0%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E8%81%94%E8%B0%83%E5%AE%9E%E9%AA%8C&diff=5232&oldid=prev Arduino77:以“右 ==實驗簡介== 為了方便電子愛好者使用多個超聲波傳感器,現(xiàn)將兩個傳感器的聯(lián)調(diào)實驗方法寫下,...”為內(nèi)容創(chuàng)建頁面 2016-04-12T08:27:42Z <p>以“<a href="/wiki/index.php/%E6%96%87%E4%BB%B6:2.png" title="文件:2.png">右</a> ==實驗簡介== 為了方便電子愛好者使用多個超聲波傳感器,現(xiàn)將兩個傳感器的聯(lián)調(diào)實驗方法寫下,...”為內(nèi)容創(chuàng)建頁面</p> <p><b>新頁面</b></p><div>[[文件:2.png|500px|縮略圖|右]]<br /> ==實驗簡介==<br /> 為了方便電子愛好者使用多個超聲波傳感器,現(xiàn)將兩個傳感器的聯(lián)調(diào)實驗方法寫下,供電子愛好者參考。<br /> ==規(guī)格參數(shù)==<br /> #工作電壓 :5V +/-10%<br /> #功耗 :20mA<br /> #工作電流:30mA<br /> #最大電流: 35mA<br /> #工作溫度范圍:0℃~+70℃<br /> #探測有效距離:2cm~3m<br /> #尺寸大?。?22 mm H x 46 mm W x 16 mm D (0.85 in x 1.8 in x 0.6 in)<br /> #重量:9g<br /> ==接口定義==<br /> *GND:電源地<br /> *5V:電源正極<br /> *SIG:信號接口<br /> ==使用方法==<br /> ===連接圖示===<br /> 兩個超聲波的INPUT引腳接在D5,OUTPUT分別接D3、D4,如下圖:<br /> [[文件:2csb.png|700px|縮略圖|居中]]<br /> ===例子程序===<br /> 依照程序連接兩個超聲波傳感器與UNO,測試實際檢測的距離。<br /> &lt;pre style='color:blue'&gt;const int pingPin = 11;<br /> int inputPin1=4; // 接超聲波的 output 引腳到數(shù)字D4腳 <br /> int outputPin=5; // 接超聲波的 input 引腳到數(shù)字D5腳 <br /> int inputPin2=3;<br /> int ledpin=13; // 定義 ledPin 引腳為D13腳<br /> void setup() <br /> { //初始化串口及引腳的輸入、輸出模式<br /> Serial.begin(9600); <br /> pinMode(ledpin,OUTPUT); <br /> pinMode(inputPin1, INPUT); <br /> pinMode(outputPin, OUTPUT); <br /> pinMode(inputPin2, INPUT); <br /> }<br /> void loop() <br /> { <br /> unsigned int x1,x2;<br /> digitalWrite(outputPin, LOW); //使發(fā)出發(fā)出超聲波信號接口低電平2 μs <br /> delayMicroseconds(2); <br /> digitalWrite(outputPin, HIGH); //使發(fā)出發(fā)出超聲波信號接口高電平10μs ,這里是至少10μs <br /> delayMicroseconds(10); <br /> digitalWrite(outputPin, LOW); // 保持發(fā)出超聲波信號接口低電平 <br /> float distance1 = pulseIn(inputPin1, HIGH); // 讀出接收脈沖的時間 <br /> distance1= distance1/58; // 將脈沖時間轉(zhuǎn)化為距離(單位:厘米) <br /> x1 = distance1 * 100.0;<br /> distance1 = x1 / 100.0; //保留兩位小數(shù) <br /> Serial.print(&quot;x1 = &quot;); <br /> Serial.println(distance1); // 輸出距離值 <br /> delay(150);<br /> <br /> digitalWrite(outputPin, LOW); //使發(fā)出發(fā)出超聲波信號接口低電平2 μs <br /> delayMicroseconds(2); <br /> digitalWrite(outputPin, HIGH); //使發(fā)出發(fā)出超聲波信號接口高電平10μs ,這里是至少10μs <br /> delayMicroseconds(10); <br /> digitalWrite(outputPin, LOW); // 保持發(fā)出超聲波信號接口低電平 <br /> float distance2 = pulseIn(inputPin2, HIGH); // 讀出接收脈沖的時間 <br /> distance2 = distance2/58; // 將脈沖時間轉(zhuǎn)化為距離(單位:厘米) <br /> x2 = distance2 * 100.0;<br /> distance2 = x2 / 100.0; //保留兩位小數(shù) <br /> Serial.print(&quot;x2 = &quot;); <br /> Serial.println(distance2); // 輸出距離值 <br /> delay(150); <br /> <br /> }<br /> }&lt;/pre&gt;<br /> ===程序效果===<br /> 打開串口監(jiān)視器可以觀察到輸出的距離值為當(dāng)前超聲波距前方障礙物的實際距離。<br /> ==產(chǎn)品相關(guān)推薦==<br /> [[文件:erweima.png|230px|無框|右]]<br /> ===產(chǎn)品購買地址===<br /> [http://m.gharee.com/goods-136.html PING)))超聲波感測器]&lt;br/&gt;<br /> ===周邊產(chǎn)品推薦===<br /> [http://m.gharee.com/goods-548.html LV-MaxSonar-EZ1 超聲波傳感器]&lt;br/&gt;<br /> [http://m.gharee.com/goods-301.html 超聲波傳感器支架]&lt;br/&gt;<br /> [http://m.gharee.com/goods-132.html 雙模式超聲波傳感器]&lt;br/&gt;<br /> ===相關(guān)問題解答===<br /> [http://www.makerspace.cn/forum.php?mod=viewthread&amp;tid=3094&amp;fromuid=10780 超聲波測距輸出的距離一直為0]&lt;br/&gt;<br /> [http://www.makerspace.cn/forum.php?mod=viewthread&amp;tid=4096&amp;highlight=%E8%B6%85%E5%A3%B0%E6%B3%A2 超聲波傳感器不工作,如何解除故障]&lt;br/&gt;<br /> ===相關(guān)學(xué)習(xí)資料===<br /> [https://www.parallax.com/sites/default/files/downloads/28029-Smart-Sensors-Text-v1.0.pdf parallax官方使用說明]&lt;br/&gt;<br /> [https://www.parallax.com/sites/default/files/downloads/28015-PING-Sensor-Product-Guide-v2.0.pdf parallax官方產(chǎn)品資料]&lt;br/&gt;<br /> [http://www.makerspace.cn/forum.php?mod=viewthread&amp;tid=4102&amp;highlight=%E8%B6%85%E5%A3%B0%E6%B3%A2 Arduino教程02--Arduino連接超聲波傳感器測距]&lt;br/&gt;<br /> [http://www.makerspace.cn/forum.php?mod=viewthread&amp;tid=2828&amp;fromuid=10780 Arduino學(xué)習(xí)筆記- Arduino連接超聲波傳感器測距]&lt;br/&gt;<br /> [http://www.makerspace.cn/portal.php 奧松機(jī)器人技術(shù)論壇]&lt;br/&gt;</div> Arduino77