![]() so -4 means a dotted quarter note, that is, a quarter plus an eighteenth!! !!negative numbers are used to represent dotted notes, a 4 means a quarter note, 8 an eighteenth, 16 sixteenth, so on notes of the moledy followed by the duration. change this to whichever pin you want to use change this to make the song slower or faster *Ĭonnect a piezo buzzer or speaker to pin 11 or select a new pin. The melody vector contains each note of the song followed by their duration. The tempo variable can be changed to make the music play faster or slower, while the buzzer variable contains the number of the pin to which the piezo is connected. With the piezo connected to the board, simply add the code with the desired song in the IDE and upload it to the Arduino. Simply copy the code into the Arduino IDE and connect a buzzer to pin 11 of your Arduino board, or connect it to any pin and edit the value of the buzzer variable accordingly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |