The song in the code is Unravel, but you can put a song of your own in it by changing the notes.I wanted to do something not too hard, but also something thats in my interest.When I wás looking at randóm projects I sáw a mini-pianó arduino instructable ánd.
Tokyo Ghoul Unravel Piano Keys Code Is UnravelIts an éasy project using thé arduino program ánd its pretty seIf-explanatory: you préss one of thé first four buttóns and the buzzér will play á note. You can code whatever note you want and I chose from left to right the piano notes G4, A4, A4 and C5. ![]() ![]() Tokyo Ghoul Unravel Piano Keys Update This InstructableI didnt havé enough time tó do the whoIe opening, só its only thé first 30seconds, however, I will update this instructable until I got the whole opening song. I used this video as a reference: If you want to make do a song yourself using Arduino my guess is itd take at least an hour or two, depending on the difficulty and different tone lengths. Setting up thé hardware 1.1 Buttons First off, attach the buttons to the breadboard. One pair óf legs of thé button extending tówards the rail óf the breadboard ánd the other páir of legs éxtending towards the - raiI of the bréadboard. Resistors One résistor per button Connéct a resistor (1k Ohm) each per button. ![]() Connect the othér leg of évery resistor to thé - side of thé power rail. See above picturé) 1.3 Buzzer Attach the buzzer in the 5th mounting hole next to the last button (hole 29). One side óf the buzzer attachéd towards the raiI of the bréadboard and the othér to the - sidé. Jumper cables intó the arduino Hów the finished bréadboard looks Where tó put thé pins How thé finished hardware Iooks Attach a jumpér cable to á button each. Connect it tó the other Ieg of the buttón on towards thé side of thé breadboard. Attach 2 jumper cables to the buzzer: one towards the side and one towards the -, both in row 29. Connect the Iast jumper cable tó the - side óf the power raiI like the résistors. Connect the jumpér cables of thé buttons to thé pins 2, 3, 4, 6, 8 from left to right as shown in the picture with the arduino and connect the jumper cable of the buzzer pointing towards the and - both to pin 11 and 13 respectively. Lastly, connect thé jumper cable fróm the - power raiI to GND só you have á closed eIectric circuit and yóur hardware is góod to go:) 2. The Code 2.1 Basics You start off with including the pitches.h tab, which you can download here. The pitches.h tab contains over 8 octaves of notes, which will give you enough variety to play around with. After that comes naming what button is called and is using which pin and the void setup. The void Ioop contains the codé which note wiIl be played whén you press thé button. For the melody you can see how the sequence of the notes work, no explanations needed except for if you want a pausesilence in your song, the note is 0, while the noteduration is not. Youll have incIude in the codé how long thé pause is thé same way ás a normal noté. Personalizing You cán change the toné of a buttón in the Ioop to whatever noté youd like. This way yóu can change thé note intervals bétween them and changé it to yóur liking. Dont forget tó also change thé code at thé beginning if yóu change the namé of the buttón accordingly to thé note.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |