Music Box! 🎶

by jerry429 in Circuits > Arduino

138 Views, 1 Favorites, 0 Comments

Music Box! 🎶

IMG-2618.jpg
IMG-2617.jpg

Do you ever feel like your room is just WAY too damn quiet for you to pay attention to your studies? Well, here's a good partner to fill your room with melodic music and a pleasant atmosphere. With just a quick press on the button, The Study Music Box jumps between tabs, and selects you with top-notch peaceful music for you to enjoy during your long study hours.

Supplies

Materials required include:

- wires x6

- Arduino Leonard board

- a button

- an Arduino Leonard cable

- a box/container/ anything that can hold the Arduino board in its entirety

- A laptop

- A pre-opened youtube tab

Step 1: Connect the Circuits

Screen Shot 2021-05-09 at 5.48.02 PM.png

Connect the circuits as shown. Make sure the circuits are fully plugged into each and every socket. Also, if you wish to place it back into your box, make sure the circuits aren't being suppressed. The needles could break and get stuck within the sockets and it can be very difficult to get them back out.

Step 2: Insert the Code / Ardublock Code

Screen Shot 2021-05-09 at 5.58.56 PM.png
Screen Shot 2021-05-09 at 5.59.10 PM.png
Screen Shot 2021-05-09 at 5.59.23 PM.png
Screen Shot 2021-05-09 at 5.59.35 PM.png
Screen Shot 2021-05-09 at 5.59.43 PM.png

Paste the following code into your tab and click the arrow pointing right to make it run: https://create.arduino.cc/editor/jerrysun2/e8f8788...

OR

Follow the Ardublock code in the images. THIS OPTION IS RECOMMENDED IF YOU ARE NEW TO ARDUINO. Click Upload to Arduino when you're done.

Brief explanation of major codes:

  • Keyboard Press: With sockets GND and 4 connected through a wire, the laptop's keyboard mistakes the Arduino board as another USB keyboard, thereafter allowing it to take over the role as the keyboard in charge. The code, when assigned with different keys, is now able to "click" them on the laptop.
  • Keyboard Release: In order for the board to let go of a key and not continuously pressing it for hours straight, there must be an order for the "finger" to let go. There are two codes for releasing: Keyboard release, and Keyboard release ALL. The former works when only a single key is being pressed, while the latter releases multiple keys.

Step 3: Embellish

IMG-2618.jpg

This step is completely optional. Find a cardboard box/ paper box/ whatever container that works, and place the Arduino Board within the box. For cardboard boxes and paper boxes, it is recommended that two voids are cut, with the first one being for the cable to go through and connect to the laptop USB socket and the second to stuff the button.

Demo Video

Music Box!

Here's a demonstration of how the project is supposed to work out in the end: