EasyManua.ls Logo

Keyestudio ESP32 - 7. Code Explanation; Project 26: Human Body Piano; 1. Description; 2. Flow Chart

Keyestudio ESP32
344 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ESP32 Starter Kit
7. Code Explanation
float checkdistance() :Self-defining function. It greatly reduces loop() by collecting some specific codes which can be
directly recalled.
delayMicroseconds(); Delay function. delay()is in ms while delayMicroseconds() is in um for some precise delays.
pulseIn(pin, value) :Pulse-grabbing function. pin: the number of the Arduino pin on which you want to read the pulse.
Allowed data types: int. value: type of pulse to read: either HIGH or LOW. Allowed data types: int.
Please refer to the website for more details[pulseIn() - Arduino Reference]:
8.5.27 Project 26: Human Body Piano
1. Description
The analog piano includes a development board and an ultrasonic sensor. It enables to play different tones by detecting
the position of your fingers. Thus, this module is able to stimulate a piano to perform music and songs.
140 Chapter 8. Arduino Tutorial

Table of Contents