This Arduino code allows you to play the iconic theme of "We Are the Champions" by Queen on a buzzer. Simply upload the code to your Arduino board, connect a buzzer, and enjoy the triumphant melody!
We_Are_The_Champions_Demo.mov
-
Connect your buzzer to the Arduino board. The positive pin (anode) should be connected to a digital pin, and the negative pin (cathode) to GND.
-
Download the supplied code to your Arduino board using the Arduino IDE or other compatible software.
-
Once the code has been downloaded, the melody will automatically start playing on the buzzer.
The melody is pre-defined in the code and corresponds to the notes required for playing "We Are the Champions". Each note is defined by its frequency and its duration.
Each note has a corresponding duration that specifies how long the note should be played. The duration is defined as a fraction of a whole note. For example, 1
represents a whole note, 2
represents a half note, 4
represents a quarter note, and so on.
Enjoy the music! 🎶