Arduino - Button Buzzer Melody
by MertArduino in Circuits > Arduino
17119 Views, 16 Favorites, 0 Comments
Arduino - Button Buzzer Melody
![Arduino Basic Tutorial 09 : Button Buzzer Melody](/proxy/?url=https://content.instructables.com/FQY/805R/IW5JCIXH/FQY805RIW5JCIXH.jpg&filename=Arduino Basic Tutorial 09 : Button Buzzer Melody)
Play a Melody using the tone() function.
With this tutorial, we will be able to hear the melody when the button is pressed.
Hardware Required
![vlcsnap-2016-12-01-21h26m49s188.png](/proxy/?url=https://content.instructables.com/FUE/1DQO/IW5JCLW0/FUE1DQOIW5JCLW0.png&filename=vlcsnap-2016-12-01-21h26m49s188.png)
- Arduino Board
- Buzzer
- Button
- 10k resistor
- Wires
- Breadboard
Connections
![vlcsnap-2016-12-01-21h27m14s742.png](/proxy/?url=https://content.instructables.com/FQQ/1LVJ/IW5JCLW2/FQQ1LVJIW5JCLW2.png&filename=vlcsnap-2016-12-01-21h27m14s742.png)
![vlcsnap-2016-12-01-21h28m15s463.png](/proxy/?url=https://content.instructables.com/FI4/5Q5W/IW5JCLXO/FI45Q5WIW5JCLXO.png&filename=vlcsnap-2016-12-01-21h28m15s463.png)
![vlcsnap-2016-12-01-21h28m36s989.png](/proxy/?url=https://content.instructables.com/FK5/DRU6/IW5JCLZ8/FK5DRU6IW5JCLZ8.png&filename=vlcsnap-2016-12-01-21h28m36s989.png)
![vlcsnap-2016-12-01-21h29m03s386.png](/proxy/?url=https://content.instructables.com/FYV/U5I7/IW5JCM2E/FYVU5I7IW5JCM2E.png&filename=vlcsnap-2016-12-01-21h29m03s386.png)
![vlcsnap-2016-12-01-21h29m23s660.png](/proxy/?url=https://content.instructables.com/FRB/NEUW/IW5JCM5N/FRBNEUWIW5JCM5N.png&filename=vlcsnap-2016-12-01-21h29m23s660.png)
![vlcsnap-2016-12-01-21h29m45s841.png](/proxy/?url=https://content.instructables.com/FEJ/V8JY/IW5JCM7M/FEJV8JYIW5JCM7M.png&filename=vlcsnap-2016-12-01-21h29m45s841.png)
![vlcsnap-2016-12-01-21h30m12s423.png](/proxy/?url=https://content.instructables.com/FOC/JEG1/IW5JCM96/FOCJEG1IW5JCM96.png&filename=vlcsnap-2016-12-01-21h30m12s423.png)
![vlcsnap-2016-12-01-21h30m41s149.png](/proxy/?url=https://content.instructables.com/FVX/6AJX/IW5JCMAW/FVX6AJXIW5JCMAW.png&filename=vlcsnap-2016-12-01-21h30m41s149.png)
![vlcsnap-2016-12-01-21h30m54s920.png](/proxy/?url=https://content.instructables.com/FNJ/GC49/IW5JCMCP/FNJGC49IW5JCMCP.png&filename=vlcsnap-2016-12-01-21h30m54s920.png)
![vlcsnap-2016-12-01-21h31m17s328.png](/proxy/?url=https://content.instructables.com/F6U/8RNZ/IW5JCMEJ/F6U8RNZIW5JCMEJ.png&filename=vlcsnap-2016-12-01-21h31m17s328.png)
- The button attach to the board
- The 10k resistor connect to the button's leg
- Resistor empty leg connect to ground
- The button's other leg connect to +5V
- The button's top leg connect to digital 12
- The buzzer attach to the board
- The buzzer's short leg (-) connect to ground
- The buzzer's long leg (+) connect to digital 8
Code
![vlcsnap-2016-12-01-21h31m48s541.png](/proxy/?url=https://content.instructables.com/FH0/O4WM/IW5JCMEY/FH0O4WMIW5JCMEY.png&filename=vlcsnap-2016-12-01-21h31m48s541.png)
- Get the Code :
http://mertarduinotutorial.blogspot.com.tr/2016/11/buzzer-button-melody.html
- First, include the pitches.h library.
If It Helps, Please Subscribe
![vlcsnap-2016-12-01-21h32m17s300.png](/proxy/?url=https://content.instructables.com/FY6/CVBO/IW5JCMHI/FY6CVBOIW5JCMHI.png&filename=vlcsnap-2016-12-01-21h32m17s300.png)
First of all, I would like to thank you for reading this guide ! I hope it helps you.
If you want to support me, you can subscribe my channel and watch my videos.