Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
GoScavenger
Published

Happy birthday Buzzer

For a birthday and make it as personal as you want

BeginnerFull instructions provided1,464
Happy birthday Buzzer

Things used in this project

Story

Read more

Schematics

img-1785_(2)_s5gfmGSpHV.jpg

Code

Happy birthday

Arduino
int buzzerPin = 8;
int c = 261;
int d = 293;
int e = 329;
int f = 349;
int g = 391;
int a = 440;
int Bb = 466;
int b = 493;
int hogeC = 523;
int achtste = 500/2;
int kwart = 1000/2;
int half = 2000/2;
void setup(){

pinMode(buzzerPin,OUTPUT);
}
void loop(){

tone(buzzerPin,c,150*2);
delay(200*2);
tone(buzzerPin,c,50*2);
delay(buzzerPin*2);
tone(buzzerPin,d,kwart);
delay(kwart);
tone(buzzerPin,c,kwart);
delay(kwart);
tone(buzzerPin,f,kwart);
delay(kwart);
tone(buzzerPin,e,half);
delay(half);
tone(buzzerPin,c,150*2);
delay(200*2);
tone(buzzerPin,c,50*2);
delay(50*2);
tone(buzzerPin,d,kwart);
delay(kwart);
tone(buzzerPin,c,kwart);
delay(kwart);
tone(buzzerPin,g,kwart);
delay(kwart);
tone(buzzerPin,f,half);
delay(half);
tone(buzzerPin,c,150*2);
delay(200*2);
tone(buzzerPin,c,50*2);
delay(50*2);
tone(buzzerPin,hogeC,kwart);
delay(kwart);
tone(buzzerPin,a,kwart);
delay(kwart);
tone(buzzerPin,f,kwart);
delay(kwart);
tone(buzzerPin,e,kwart);
delay(kwart);
tone(buzzerPin,d,half);
delay(half);
tone(buzzerPin,Bb,150*2);
delay(200*2);
tone(buzzerPin,Bb,50*2);
delay(50*2);
tone(buzzerPin,a,kwart);
delay(kwart);
tone(buzzerPin,f,kwart);
delay(kwart);
tone(buzzerPin,g,kwart);
delay(kwart);
tone(buzzerPin,f,half);
delay(half);

}

Credits

GoScavenger
1 project • 1 follower
3D printing Arduino M5stack
Contact

Comments

Please log in or sign up to comment.