Keyestudio ESP32 Manual page 126

Starter kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

ESP32 Starter Kit
3. Wiring Diagram
4. Test Code
Connect the sensor to pin IO33. Read the sound analog value through analogRead(Pin) function and print it on serial
monitor.
/*
keyestudio ESP32 Inventor Learning Kit
Project 21.1Sound Controlled LED
http://www.keyestudio.com
*/
int
sound
=
33;
//Define sound as IO33
void
setup(){
Serial.begin(9600);
pinMode(sound,INPUT);
}
void
loop(){
int
value
=
analogRead(sound);
Serial.println(value);
}
122
Chapter 8. Arduino Tutorial

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Related Products for Keyestudio ESP32

Table of Contents

Save PDF