If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
Tag Archives: Sound
Arduino Tutorial 23: Changing Tone of an Active Buzzer
If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
The video above takes you through the hookup and the steps. Also, the code used in the example above is:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
int buzzPin=8; int dt1=1; int dt2=2; int j; void setup() { // put your setup code here, to run once: pinMode(buzzPin, OUTPUT); } void loop() { for (j=1;j<=100;j=j+1){ digitalWrite(buzzPin, HIGH); delay(dt1); digitalWrite(buzzPin, LOW); delay(dt1); } for (j=1; j<=100;j=j+1){ digitalWrite(buzzPin, HIGH); delay(dt2); digitalWrite(buzzPin, LOW); delay(dt2); } } |
Arduino Tutorial 22: Understanding and Using Active Buzzers to Add Sound to Your Project
The advantage of the active buzzer is that it is easier to use. Just apply 5 volts, and it goes off. The advantage of the passive buzzer is that it is cheaper, and allows you more control of the tone, or pitch of the sound produced. If you want to follow along at home, an official Arduino Uno R3 is available HERE. In this new series of lessons, I will be using the sensor and other components found in this KIT.
