Arduino Piano

by 黃昱睿 in Circuits > Arduino

157 Views, 1 Favorites, 0 Comments

Arduino Piano

IMG_20230506_222707.jpg






Supplies

IMG_20230506_214854.jpg

Arduino board

Membrane keypad

Buzzer or piezo buzzer

Jumper wires

Battery or USB cable

Wire cutters

Soldering iron and solder (optional)

Step 2: Connect the Membrane Keypad to the Arduino Board


Connect the Membrane Keypad to the Arduino Board

IMG_20230430_103829.jpg
IMG_20230430_120937.jpg
IMG_20230430_120941.jpg
IMG_20230430_120948.jpg
IMG_20230506_214854.jpg



Connect the six pins on the membrane keypad to six digital input pins on the Arduino board, according to the wiring diagram for the keypad and the Arduino board. If necessary, use a soldering iron and solder to make the connections.


Connect the Buzzer or Piezo Buzzer to the Arduino Board

IMG_20230430_120941.jpg
IMG_20230506_214854.jpg




Connect the positive lead of the buzzer or piezo buzzer (usually red) to a digital output pin on the Arduino board, and connect the negative lead (usually black) to a ground pin on the Arduino board.

Write the Code

螢幕擷取畫面 2023-05-06 231740.png

Use the Arduino IDE (Integrated Development Environment) to write the code that allows the Arduino board to detect keypad events and play the corresponding music. The code should include the following