SunFounder ESP32 Starter Kit
• The function uses a switch statement to match the decoded value with the corresponding key and
returns the string representation of the key.
• If the decoded value does not match any known key, the function returns the string “ERROR”.
6. Funny Projects
1.31 6.1 Fruit Piano
Have you ever wanted to play the piano but couldn’t afford one? Or maybe you just want to have some fun with diy a
fruit piano? Well, this project is for you!
With just a few touch sensors on the ESP32 board, you can now play your favorite tunes and enjoy the experience of
playing the piano without breaking the bank.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name ITEMS IN THIS KIT LINK
ESP32 Starter Kit 320+
You can also buy them separately from the links below.
COMPONENT INTRODUCTION PURCHASE LINK
ESP32 WROOM 32E
ESP32 Camera Extension -
Jumper Wires
Resistor
Buzzer
Transistor
About the Touch Pins
The ESP32 microcontroller has built-in touch sensor functionality, which allows you to use certain pins on the board
as touch-sensitive inputs. The touch sensor works by measuring changes in capacitance on the touch pins, which are
caused by the electrical properties of the human body.
Here are some key features of the touch sensor on the ESP32:
• Number of touch pins
The ESP32 has up to 10 touch pins, depending on the specific board. The touch pins are typically
labeled with a “T” followed by a number.
– GPIO4: TOUCH0
– GPIO0TOUCH1
– GPIO2: TOUCH2
1.31. 6.1 Fruit Piano 107