My second arduino project : 5 tone piano

hi,
this is my second arduino project,
its a 5 tone piano.
it was easy for putting some button and a couple of wire but really annoying when i coudnt
put 5 button codes into one sketch.
but i finally found how to do it :smiley: :grin: :smiley:

heres the link:

Could be an interesting start to something bigger - add some more buttons playing actual notes (A = 440 Hz), or allow 2 notes to play at one time?

as already said, my other button are deffected.
and i cant play two notes at the same time because i already tryed it.

and really have no ideas to what to make with my arduino.
worst, i dont have alot if time because i'm secondry 2 (grade 8) and im already getting alot of homework and study to do.

You have 6 PWM outputs, they can be on together - write some code to output a PWM tone when a button is pressed.

PWM outputs will only output the same frequency, different pulse width.

Using the Tone library (not the tone() function built in to the IDE) will allow you to play 2 notes at a time easily. Even 3 at a time is possible, but you won't be able to use millis() and delay(), I believe. (I could be wrong)