“(SKU:RB-02S093)Speaker模塊”的版本間的差異
來自ALSROBOT WiKi
(→?產(chǎn)品相關(guān)推薦) |
(→?周邊產(chǎn)品推薦) |
||
第78行: | 第78行: | ||
[http://m.gharee.com/goods-701.html Speaker模塊] | [http://m.gharee.com/goods-701.html Speaker模塊] | ||
===周邊產(chǎn)品推薦=== | ===周邊產(chǎn)品推薦=== | ||
? | [http://m.gharee.com/goods-169.html | + | [http://m.gharee.com/goods-169.html 蜂鳴器發(fā)聲模塊]<br/> |
? | [http://m.gharee.com/goods-546.html Carduino UNO 控制器]<br/> | + | [http://m.gharee.com/goods-546.html Carduino UNO R3 控制器]<br/> |
[http://m.gharee.com/goods-196.html 3P 傳感器連接線]<br/> | [http://m.gharee.com/goods-196.html 3P 傳感器連接線]<br/> | ||
+ | |||
===相關(guān)問題解答=== | ===相關(guān)問題解答=== | ||
[http://www.makerspace.cn/forum.php?mod=viewthread&tid=5679&fromuid=10780 【模塊篇】Speaker聲音輸出模塊音樂播放]<br/> | [http://www.makerspace.cn/forum.php?mod=viewthread&tid=5679&fromuid=10780 【模塊篇】Speaker聲音輸出模塊音樂播放]<br/> | ||
===相關(guān)學(xué)習(xí)資料=== | ===相關(guān)學(xué)習(xí)資料=== | ||
[http://www.makerspace.cn/portal.php 奧松機(jī)器人技術(shù)論壇]<br/> | [http://www.makerspace.cn/portal.php 奧松機(jī)器人技術(shù)論壇]<br/> |
2015年11月11日 (三) 09:57的版本
目錄 |
產(chǎn)品概述
此產(chǎn)品由功率放大和一個(gè)揚(yáng)聲器組成。聲音大小可以通過電路板上的電位器調(diào)整。輸入不同的頻率,揚(yáng)聲器產(chǎn)生不同的音調(diào)??梢酝ㄟ^Arduino進(jìn)行編碼并DIY自己的音樂盒!此款產(chǎn)品數(shù)據(jù)接口采用防插反插頭,接口兩側(cè)分別有字母“D”代表信號(hào)類型為數(shù)字信號(hào),和 “揚(yáng)聲器”標(biāo)識(shí)代表模塊類型,特設(shè)4顆M3固定安裝孔,調(diào)節(jié)方向與固定方便易用,美觀大方。
規(guī)格參數(shù)
- 工作電壓 :5v
- 尺寸大?。?5mm x 25mm
- 重量大?。?g
- 信號(hào)類型:數(shù)字信號(hào)
接口定義
- S:信號(hào)引腳
- -:電源地
- +:電源正極
使用方法
使用硬件
- Carduino UNO 控制器*1個(gè)
- Speaker 模塊*1個(gè)
- 3P 傳感器連接線*1條
連接圖
例子程序
如圖連接圖所示將Speaker模塊連接到UNO控制器的D3引腳,將例子程序編譯上傳到Carduino UNO 控制器中。
#define SPEAKER 3 int BassTab[]={1911,1702,1516,1431,1275,1136,1012};//bass 1~7 void setup() { pinInit(); } void loop() { /*sound bass 1~7*/ for(int note_index=0;note_index<7;note_index++) { sound(note_index); delay(500); } } void pinInit() { pinMode(SPEAKER,OUTPUT); digitalWrite(SPEAKER,LOW); } void sound(uint8_t note_index) { for(int i=0;i<100;i++) { digitalWrite(SPEAKER,HIGH); delayMicroseconds(BassTab[note_index]); digitalWrite(SPEAKER,LOW); delayMicroseconds(BassTab[note_index]); } }
程序效果
電路正確連接后speaker模塊會(huì)發(fā)出7個(gè)音階的聲音。
視頻演示
產(chǎn)品相關(guān)推薦
產(chǎn)品購買地址
周邊產(chǎn)品推薦
蜂鳴器發(fā)聲模塊
Carduino UNO R3 控制器
3P 傳感器連接線