Simple Buzzer Music
A simple library to output your own songs with the Arduino through a buzzer or speaker.
A small example of the song "praeludium" by Johann Sebastian Bach is included.
Supplies
- 1 x Arduino Uno / Mega / Nano
- 1 x speaker / buzzer
- 2 x jumper wires
- 1 x basic knowledge of music
Download the Library
Download the Zip file: music.zip
Source: https://github.com/Lukas0276/Simple-Buzzer-Music/b...
Include the library as shown in the picture.
Navigate to: Downloads\music.zip
Open the Basic Example
Go to Examples / Music / Basic
You can also try the praeludium demo "praeludium" (already converted).
Convert Your Song
Convert your sheet into tones for the code (as shown in the picture).
If you need more information, just have a look at the praeludium demo for a better understanding.
Wire Up the Arduino
Wire the Arduino as shown in the schematic.
Upload Your Code
Upload your modified basic code to the Arduino.
(or the praeludium demo)
Enjoy Your Music
Thank you for following this tutorial. It was created to improve my understanding of libraries. So feel free to look at the files: music.h, music.cpp and README.txt to get a basic understanding of the library.
If you want to create your own library, just follow this tutorial: https://www.arduino.cc/en/Hacking/LibraryTutorial
If you want to make the whole thing more professional I can recommend this tutorial:
https://www.instructables.com/id/Translate-Songs-...
I hope you learned something. Have fun with the library!