I have this task where I have to build a simple musical device that plays the Chorus of our school song, every time a button is pushed. A second button (or a potentiometer) will fade the volume up or down. I have no idea on what to do and the rest of the class is stuck on the same thing. I have got the song down pat, all I need is the coding and layout for the volume and the 'on' button. It doesn't need to turn it off. We can also use a button to change the volume.
I would really appreciate it if someone could help because I am absolutely HOPELESS
(If you want to see my coding, please just ask. There will be some errors in there and I will be delighted if you could pick them up)
how about an iPod? ;)
I have to build a simple musical device that plays the Chorus of our school song
That's the "hard part." You'll need an "audio shield" or "MP3 shield". The shield will have the memory to store the song and the digital-to-analog converter. So, the Arduino is just a "controller".
...every time a button is pushed.
That's just an if-statement
in software. Look at the button example
A second button (or a potentiometer) will fade the volume up or down.
A pot at the analog output is the easiest way to go. Make sure to get an "audio taper" pot. Your ears are not linear and a regular linear pot will sound too loud at the half-way point. But... You'll need an amplifier to drive a speaker and the amp should have a volume control already.
Or, if the audio shield you choose has digital volume control, you can use either a pot on an Arduino analog input, or volume-up and volume-down buttons on digital inputs (again with if-statements).