“(SKU:RB-02S093)Speaker模塊”的版本間的差異

來自ALSROBOT WiKi
跳轉(zhuǎn)至: 導(dǎo)航搜索
?產(chǎn)品相關(guān)推薦
?周邊產(chǎn)品推薦
第78行: 第78行:
 
[http://lifestyle201.com/goods-701.html Speaker模塊]
 
[http://lifestyle201.com/goods-701.html Speaker模塊]
 
===周邊產(chǎn)品推薦===
 
===周邊產(chǎn)品推薦===
?
[http://lifestyle201.com/goods-169.html 蜂鳴器模塊]<br/>
+
[http://lifestyle201.com/goods-169.html 蜂鳴器發(fā)聲模塊]<br/>
?
[http://lifestyle201.com/goods-546.html Carduino UNO 控制器]<br/>
+
[http://lifestyle201.com/goods-546.html Carduino UNO R3 控制器]<br/>
 
[http://lifestyle201.com/goods-196.html 3P 傳感器連接線]<br/>
 
[http://lifestyle201.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 奧松機器人技術(shù)論壇]<br/>
 
[http://www.makerspace.cn/portal.php 奧松機器人技術(shù)論壇]<br/>

2015年11月11日 (三) 09:57的版本

RB02S09301.png

目錄

產(chǎn)品概述

此產(chǎn)品由功率放大和一個揚聲器組成。聲音大小可以通過電路板上的電位器調(diào)整。輸入不同的頻率,揚聲器產(chǎn)生不同的音調(diào)。可以通過Arduino進行編碼并DIY自己的音樂盒!此款產(chǎn)品數(shù)據(jù)接口采用防插反插頭,接口兩側(cè)分別有字母“D”代表信號類型為數(shù)字信號,和 “揚聲器”標(biāo)識代表模塊類型,特設(shè)4顆M3固定安裝孔,調(diào)節(jié)方向與固定方便易用,美觀大方。

規(guī)格參數(shù)

  1. 工作電壓 :5v
  2. 尺寸大?。?5mm x 25mm
  3. 重量大?。?g
  4. 信號類型:數(shù)字信號

接口定義

  • S:信號引腳
  • -:電源地
  • +:電源正極

使用方法

使用硬件

  • Carduino UNO 控制器*1個
  • Speaker 模塊*1個
  • 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模塊會發(fā)出7個音階的聲音。

視頻演示

Speaker01.png


















產(chǎn)品相關(guān)推薦

Erweima.png

產(chǎn)品購買地址

Speaker模塊

周邊產(chǎn)品推薦

蜂鳴器發(fā)聲模塊
Carduino UNO R3 控制器
3P 傳感器連接線

相關(guān)問題解答

【模塊篇】Speaker聲音輸出模塊音樂播放

相關(guān)學(xué)習(xí)資料

奧松機器人技術(shù)論壇