Add the following snippet to your HTML:<iframe frameborder='0' height='385' scrolling='no' src='https://www.hackster.io/55843/innovation-lab-10-piezo-buzzer-plays-the-school-song-43175e/embed' width='350'></iframe>
A Bongilcheon High School Innovation Lab project.
Read up about this project on
Innovation Lab (170821)
I played our school song using the buzzer I just learned how to utilize.
int speakerpin = 7; int melody[] = {} int noteDurations[] = {} void setup() { for (int thisNote = 0; thisNote < 24; thisNote++) { int noteDuration = 1000 / noteDurations[thisNote]; tone(speakerpin, melody[thisNote], noteDuration); int pauseBetweenNotes = noteDuration * 1.30; delay(pauseBetweenNotes); noTone(speakerpin); } } void loop() { }
Please log in or sign up to comment.
Comments
Please log in or sign up to comment.