EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #71 background imageLoading...
Page #71 background image
SunFounder ESP32 Starter Kit
How it works
The previous projects all involved outputting signals, either in the form of digital or PWM signals.
This project involves receiving input signals from external component to the ESP32 board. You can view the input
signal through the Serial Monitor in Arduino IDE.
1. In the setup() function, the button pin is initialized as an input and the LED pin is initialized as an output.
The Serial communication is also initiated with a baud rate of 115200.
void setup() {
Serial.begin(115200);
// initialize the button pin as an input
pinMode(buttonPin, INPUT);
// initialize the LED pin as an output
pinMode(ledPin, OUTPUT);
}
• Serial.begin(speed): Sets the data rate in bits per second (baud) for serial data transmission.
– speed: in bits per second (baud). Allowed data types: long.
2. In the loop() function, the state of the button is read and stored in the variable buttonState. The value of
buttonState is printed to the Serial Monitor using Serial.println().
1.17. 5.1 Reading Button Value 65

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish