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 #365 background imageLoading...
Page #365 background image
SunFounder ESP32 Starter Kit
(continued from previous page)
if button.value() == 1:
# Turn on the LED by setting its value to 1
led.value(1)
# time.sleep(0.5)
else:
# Turn off the LED
led.value(0)
During script execution, the LED lights up when you press the button and goes out when you release it.
3.20 5.2 Tilt It
The tilt switch is a simple yet effective 2-pin device that contains a metal ball in its center. When the switch is in an
upright position, the two pins are electrically connected, allowing current to flow through. However, when the switch
is tilted or tilted at a certain angle, the metal ball moves and breaks the electrical connection between the pins.
In this project, we will utilize the tilt switch to control the illumination of an LED. By positioning the switch in a way
that triggers the tilt action, we can toggle the LED on and off based on the switchs orientation.
Required Components
In this project, we need the following components.
Its definitely convenient to buy a whole kit, heres 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 -
Breadboard
Jumper Wires
Resistor
LED
Tilt Switch -
Available Pins
Available Pins
Here is a list of available pins on the ESP32 board for this project.
3.20. 5.2 Tilt It 359

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