Microduino-Buzzer
1304410487@qq.com(讨论 | 贡献)2015年11月1日 (日) 04:39的版本
| Language | English | 
|---|
| 
 文件:Microduino-BUZZER.jpg   Microduino-Buzzer Microduino-Buzzer是无源蜂鸣器,和电磁扬声器一样,需要高低变化不同频率的电压才能发声。频率越高则音调越高。 Microduino-Buzzer is a passive buzzer. Like a magnetic speaker, it needs voltage with different frequency so that it can make sound accordingly. The pitch becomes louder when the frequency gets higher. 
 
 目录[隐藏]Feature
 Specification
 
 Document
 DevelopmentIt can be used to make various kinds of sound through the buzzer. Application
 #define buzzer_pin 6
void setup()
{
  pinMode(buzzer_pin,OUTPUT);
}
 
void loop()
{
  for(int i=200;i<=800;i++)  //Increase the frequency from 200HZ to 800HZ circularly. 
  {
    tone(buzzer_pin,i);    //Output frequency in the port. 
    delay(5);      //The frequency lasts for 5ms.  
  }
  delay(1000);     //The highest frequency lasts for 1s. 
  for(int i=800;i>=200;i--)
  {
    tone(buzzer_pin,i);
    delay(10); //The frequency lasts 10ms.   
  }
}
 
 
 PurchaseHistoryImage
 文件:Microduino-Buzzer-F.JPG   Microduino-Cube-Station Front 
 文件:Microduino-Buzzer -b.JPG   Microduino-Cube-Station Back  |