If you want to follow along at home, you can order the Arduino Kit we are using HERE.
Tag Archives: Sound
Arduino Tutorial 23: Changing Tone of an Active Buzzer
If you want to follow along at home, you can order the Arduino Kit we are using HERE.
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, you can order the Arduino Kit we are using HERE.