Music is composed of many different scales, and each scale corresponds to a different frequency, so that we can use different frequency combinations to form the music we want. Of course, it is very convenient for the single chip microcomputer to generate different frequencies. We can use the timer/counter T0 of the single chip microcomputer to generate a square wave frequency signal, so we just need to get the frequency response relationship of the tune of a song right.
Key words: microcontroller, button, speaker, chromatic scale.